pixled-lib
1.0
|
#include <color.h>
Public Member Functions | |
uint8_t | red () const |
uint8_t | green () const |
uint8_t | blue () const |
float | hue () const |
float | saturation () const |
float | brightness () const |
color & | setRgb (uint8_t r, uint8_t g, uint8_t b) |
color & | setRed (uint8_t r) |
color & | setGreen (uint8_t g) |
color & | setBlue (uint8_t b) |
color & | setHsb (float h, float s, float b) |
color & | setHue (float h) |
color & | setSaturation (float s) |
color & | setBrightness (float b) |
Static Public Member Functions | |
static color | rgb (uint8_t r, uint8_t g, uint8_t b) |
static color | hsb (float h, float s, float b) |
Fundamental type representing a color.
|
inline |
Red color component, in [0, 255].
|
inline |
Green color component, in [0, 255].
|
inline |
Blue color component, in [0, 255].
|
inline |
Hue, in [0, 360].
|
inline |
Saturation, in [0, 1].
|
inline |
Brightness, in [0, 1].
color & pixled::color::setRgb | ( | uint8_t | r, |
uint8_t | g, | ||
uint8_t | b | ||
) |
Sets the RGB values of this color.
r | red |
g | green |
b | blue |
color & pixled::color::setRed | ( | uint8_t | r | ) |
Sets the Red component value of this color.
r | red |
color & pixled::color::setGreen | ( | uint8_t | g | ) |
Sets the Green component value of this color.
g | green |
color & pixled::color::setBlue | ( | uint8_t | b | ) |
Sets the Blue component value of this color.
b | blue |
color & pixled::color::setHsb | ( | float | h, |
float | s, | ||
float | b | ||
) |
Sets the HSB values of this color.
h | hue |
s | saturation |
b | brightness |
color & pixled::color::setHue | ( | float | h | ) |
Sets the hue of this color.
h | hue |
color & pixled::color::setSaturation | ( | float | s | ) |
Sets the saturation of this color.
s | saturation. |
color & pixled::color::setBrightness | ( | float | b | ) |
Sets the brightness of this color.
b | brightness. |
|
static |
Builds a color instance from RGB values.
r | red |
g | green |
b | blue |
|
static |
Builds a color instance from HSB values.
h | hue |
s | saturation |
b | brightness |