An RGBA colour, 8 bits per channel, with conversions to and from packed formats (RGB565, RGB888, ARGB8888, RGBA8888), floats and HSV.
More...
#include <deki/Color.h>
|
| | Color () |
| | Color (uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha=255) |
| uint16_t | ToRGB565 () const |
| uint32_t | ToRGB888 () const |
| uint32_t | ToARGB8888 () const |
| uint32_t | ToRGBA8888 () const |
| uint32_t | ToABGR8888 () const |
| void | ToFloats (float &r, float &g, float &b, float &a) const |
| | Channels in 0..1.
|
| void | ToHSV (float &h, float &s, float &v) const |
| Color | Lerp (const Color &to, float t) const |
| Color | Multiply (float factor) const |
| Color | Tint (const Color &tintColor, float intensity) const |
| Color | WithAlpha (uint8_t newAlpha) const |
| uint8_t | GetLuminance () const |
| Color | ToGrayscale () const |
| Color | AdjustBrightness (float factor) const |
| Color | AdjustSaturation (float factor) const |
| bool | operator== (const Color &other) const |
| bool | operator!= (const Color &other) const |
|
| uint8_t | r |
| uint8_t | g |
| uint8_t | b |
| uint8_t | a |
|
| static const Color | Black { 0, 0, 0 } |
| static const Color | White { 255, 255, 255 } |
| static const Color | Red { 255, 0, 0 } |
| static const Color | Green { 0, 255, 0 } |
| static const Color | Blue { 0, 0, 255 } |
| static const Color | Yellow { 255, 255, 0 } |
| static const Color | Cyan { 0, 255, 255 } |
| static const Color | Magenta { 255, 0, 255 } |
| static const Color | Gray { 128, 128, 128 } |
| static const Color | DarkGray { 64, 64, 64 } |
| static const Color | LightGray { 192, 192, 192 } |
| static const Color | Orange { 255, 165, 0 } |
| static const Color | Purple { 128, 0, 128 } |
| static const Color | Brown { 139, 69, 19 } |
| static const Color | Pink { 255, 192, 203 } |
| static const Color | Transparent { 0, 0, 0, 0 } |
| static const Color | SkyBlue { 135, 206, 235 } |
| static const Color | GrassGreen { 124, 252, 0 } |
| static const Color | SunsetOrange { 255, 94, 77 } |
| static const Color | NightBlue { 25, 25, 112 } |
An RGBA colour, 8 bits per channel, with conversions to and from packed formats (RGB565, RGB888, ARGB8888, RGBA8888), floats and HSV.
◆ Color() [1/2]
◆ Color() [2/2]
| Deki::Color::Color |
( |
uint8_t | red, |
|
|
uint8_t | green, |
|
|
uint8_t | blue, |
|
|
uint8_t | alpha = 255 ) |
|
inline |
◆ FromRGB565()
| Color Deki::Color::FromRGB565 |
( |
uint16_t | rgb565 | ) |
|
|
inlinestatic |
◆ FromRGB888()
| Color Deki::Color::FromRGB888 |
( |
uint32_t | rgb888 | ) |
|
|
inlinestatic |
◆ FromARGB8888()
| Color Deki::Color::FromARGB8888 |
( |
uint32_t | argb8888 | ) |
|
|
inlinestatic |
◆ FromRGBA8888()
| Color Deki::Color::FromRGBA8888 |
( |
uint32_t | rgba8888 | ) |
|
|
inlinestatic |
◆ FromFloats()
| Color Deki::Color::FromFloats |
( |
float | r, |
|
|
float | g, |
|
|
float | b, |
|
|
float | a = 1.0f ) |
|
static |
◆ FromHSV()
| Color Deki::Color::FromHSV |
( |
float | h, |
|
|
float | s, |
|
|
float | v, |
|
|
float | a = 1.0f ) |
|
static |
◆ ToRGB565()
| uint16_t Deki::Color::ToRGB565 |
( |
| ) |
const |
|
inline |
◆ ToRGB888()
| uint32_t Deki::Color::ToRGB888 |
( |
| ) |
const |
|
inline |
◆ ToARGB8888()
| uint32_t Deki::Color::ToARGB8888 |
( |
| ) |
const |
|
inline |
◆ ToRGBA8888()
| uint32_t Deki::Color::ToRGBA8888 |
( |
| ) |
const |
|
inline |
◆ ToABGR8888()
| uint32_t Deki::Color::ToABGR8888 |
( |
| ) |
const |
|
inline |
◆ ToFloats()
| void Deki::Color::ToFloats |
( |
float & | r, |
|
|
float & | g, |
|
|
float & | b, |
|
|
float & | a ) const |
◆ ToHSV()
| void Deki::Color::ToHSV |
( |
float & | h, |
|
|
float & | s, |
|
|
float & | v ) const |
◆ Lerp()
| Color Deki::Color::Lerp |
( |
const Color & | to, |
|
|
float | t ) const |
◆ Multiply()
| Color Deki::Color::Multiply |
( |
float | factor | ) |
const |
◆ Tint()
| Color Deki::Color::Tint |
( |
const Color & | tintColor, |
|
|
float | intensity ) const |
◆ WithAlpha()
| Color Deki::Color::WithAlpha |
( |
uint8_t | newAlpha | ) |
const |
|
inline |
◆ GetLuminance()
| uint8_t Deki::Color::GetLuminance |
( |
| ) |
const |
|
inline |
◆ ToGrayscale()
| Color Deki::Color::ToGrayscale |
( |
| ) |
const |
◆ AdjustBrightness()
| Color Deki::Color::AdjustBrightness |
( |
float | factor | ) |
const |
◆ AdjustSaturation()
| Color Deki::Color::AdjustSaturation |
( |
float | factor | ) |
const |
◆ operator==()
| bool Deki::Color::operator== |
( |
const Color & | other | ) |
const |
|
inline |
◆ operator!=()
| bool Deki::Color::operator!= |
( |
const Color & | other | ) |
const |
|
inline |
◆ Black
| const Color Deki::Color::Black { 0, 0, 0 } |
|
inlinestatic |
◆ White
| const Color Deki::Color::White { 255, 255, 255 } |
|
inlinestatic |
◆ Red
| const Color Deki::Color::Red { 255, 0, 0 } |
|
inlinestatic |
◆ Green
| const Color Deki::Color::Green { 0, 255, 0 } |
|
inlinestatic |
◆ Blue
| const Color Deki::Color::Blue { 0, 0, 255 } |
|
inlinestatic |
◆ Yellow
| const Color Deki::Color::Yellow { 255, 255, 0 } |
|
inlinestatic |
◆ Cyan
| const Color Deki::Color::Cyan { 0, 255, 255 } |
|
inlinestatic |
◆ Magenta
| const Color Deki::Color::Magenta { 255, 0, 255 } |
|
inlinestatic |
◆ Gray
| const Color Deki::Color::Gray { 128, 128, 128 } |
|
inlinestatic |
◆ DarkGray
| const Color Deki::Color::DarkGray { 64, 64, 64 } |
|
inlinestatic |
◆ LightGray
| const Color Deki::Color::LightGray { 192, 192, 192 } |
|
inlinestatic |
◆ Orange
| const Color Deki::Color::Orange { 255, 165, 0 } |
|
inlinestatic |
◆ Purple
| const Color Deki::Color::Purple { 128, 0, 128 } |
|
inlinestatic |
◆ Brown
| const Color Deki::Color::Brown { 139, 69, 19 } |
|
inlinestatic |
◆ Pink
| const Color Deki::Color::Pink { 255, 192, 203 } |
|
inlinestatic |
◆ Transparent
| const Color Deki::Color::Transparent { 0, 0, 0, 0 } |
|
inlinestatic |
◆ SkyBlue
| const Color Deki::Color::SkyBlue { 135, 206, 235 } |
|
inlinestatic |
◆ GrassGreen
| const Color Deki::Color::GrassGreen { 124, 252, 0 } |
|
inlinestatic |
◆ SunsetOrange
| const Color Deki::Color::SunsetOrange { 255, 94, 77 } |
|
inlinestatic |
◆ NightBlue
| const Color Deki::Color::NightBlue { 25, 25, 112 } |
|
inlinestatic |
The documentation for this class was generated from the following file: