2 #ifndef __blip_Color_hpp 3 #define __blip_Color_hpp 21 explicit Color(uint32_t rgba)
throw();
26 Color(uint8_t red = 0, uint8_t green = 0, uint8_t blue = 0,
27 uint8_t alpha = 255)
throw();
33 inline void setRed(uint8_t red)
throw()
37 inline uint8_t
getRed()
const throw()
65 void setColor(
int red,
int green,
int blue,
int alpha)
throw();
68 void setRGBA(uint32_t rgba)
throw();
71 uint32_t
toRGBA()
const throw();
74 void getHSL(
float* hue,
float* saturation,
float* lightness)
const throw();
77 void setHSL(
float hue,
float saturation,
float lightness)
throw();
118 float hueToRGB(
float a,
float b,
float h)
const throw();
128 #endif // __blip_Color_h static const Color BLUE
Blue (#0000FF)
Definition: Color.hpp:82
static const Color DARK_GREEN
Dark green (#008000)
Definition: Color.hpp:92
static const Color DARK_RED
Dark red (#800000)
Definition: Color.hpp:96
void setRGBA(uint32_t rgba)
Set the color from the 32-bit packed RGBA representation.
Definition: Color.cpp:62
void setAlpha(uint8_t alpha)
Set the alpha component of the color.
Definition: Color.hpp:57
A color with red, green, blue, and alpha components.
Definition: Color.hpp:14
uint8_t getGreen() const
Get the green component of the color.
Definition: Color.hpp:45
uint8_t getBlue() const
Get the blue component of the color.
Definition: Color.hpp:53
void setBlue(uint8_t blue)
Set the blue component of the color.
Definition: Color.hpp:49
static const Color WHITE
White (#FFFFFF)
Definition: Color.hpp:112
static const Color GREEN
Green (#00FF00)
Definition: Color.hpp:102
void setHSL(float hue, float saturation, float lightness)
Set this color using hue, saturation, and lightness values.
Definition: Color.cpp:154
static const Color LIGHT_GRAY
Light gray (#C0C0C0)
Definition: Color.hpp:104
~Color()
Destructor.
Definition: Color.cpp:55
static const Color DARK_CYAN
Dark cyan (#008080)
Definition: Color.hpp:88
static const Color GRAY
Gray (#A0A0A0)
Definition: Color.hpp:100
WAV file format details at: https://ccrma.stanford.edu/courses/422/projects/WaveFormat/.
Definition: AccelerometerSensorEvent.cpp:3
void setColor(int red, int green, int blue, int alpha)
Set all components of the color.
Definition: Color.cpp:76
uint32_t toRGBA() const
Get the color's 32-bit packed RGBA representation.
Definition: Color.cpp:87
static const Color CYAN
Cyan (#00FFFF)
Definition: Color.hpp:84
static const Color DARK_GRAY
Dark gray (#808080)
Definition: Color.hpp:90
static const Color DARK_YELLOW
Dark yellow (#808000)
Definition: Color.hpp:98
static const Color YELLOW
Yellow (#FFFF00)
Definition: Color.hpp:114
static const Color RED
Red (#FF0000)
Definition: Color.hpp:108
void setRed(uint8_t red)
Set the red component of the color.
Definition: Color.hpp:33
static const Color BLACK
Black (#000000)
Definition: Color.hpp:80
void setGreen(uint8_t green)
Set the green component of the color.
Definition: Color.hpp:41
uint8_t getRed() const
Get the red component of the color.
Definition: Color.hpp:37
void getHSL(float *hue, float *saturation, float *lightness) const
Get the hue, saturation, and lightness values for this color.
Definition: Color.cpp:104
uint8_t getAlpha() const
Get the alpha component of the color.
Definition: Color.hpp:61
Color(uint32_t rgba)
Construct a new Color from the given packed 32-bit RGBA representation.
Definition: Color.cpp:47
static const Color DARK_BLUE
Dark blue (#000080)
Definition: Color.hpp:86
static const Color TRANSPARENT
Transparent black.
Definition: Color.hpp:110
static const Color MAGENTA
Magenta (#FF00FF)
Definition: Color.hpp:106
static const Color DARK_MAGENTA
Dark magenta (#800080)
Definition: Color.hpp:94