Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
UTILS::COLOR Namespace Reference

Classes

struct  ColorFloats
 
struct  ColorInfo
 

Typedefs

typedef uint32_t Color
 

Functions

Color ChangeOpacity (const Color argb, const float opacity)
 Change the opacity of a given ARGB color.
 
Color ConvertToRGBA (const Color argb)
 Convert given ARGB color to RGBA color value.
 
Color ConvertToARGB (const Color rgba)
 Convert given RGBA color to ARGB color value.
 
Color ConvertToBGR (const Color argb)
 Convert given ARGB color to BGR color value.
 
Color ConvertHexToColor (const std::string &hexColor)
 Convert given hex value to Color value.
 
Color ConvertIntToRGB (int r, int g, int b)
 Convert given RGB int values to RGB color value.
 
ColorInfo MakeColorInfo (const Color &argb)
 Create a ColorInfo from an ARGB Color to get additional information of the color and allow to be sorted with a color comparer.
 
ColorInfo MakeColorInfo (const std::string &hexColor)
 Create a ColorInfo from an HEX color value to get additional information of the color and allow to be sorted with a color comparer.
 
bool comparePairColorInfo (const std::pair< std::string, ColorInfo > &a, const std::pair< std::string, ColorInfo > &b)
 Comparer for pair string/ColorInfo to sort colors in a hue scale.
 
ColorFloats ConvertToFloats (const Color argb)
 Convert given ARGB color to ColorFloats.
 
std::string ConvertToHexRGB (const Color argb)
 Convert given ARGB color to hex RGB color value.
 

Variables

constexpr Color NONE = 0x00000000
 
constexpr Color LIMITED_BLACK = 0xFF101010
 
constexpr Color WHITE = 0xFFFFFFFF
 
constexpr Color SILVER = 0xFFC0C0C0
 
constexpr Color GRAY = 0xFF808080
 
constexpr Color BLACK = 0xFF000000
 
constexpr Color RED = 0xFFFF0000
 
constexpr Color MAROON = 0xFF800000
 
constexpr Color YELLOW = 0xFFFFFF00
 
constexpr Color OLIVE = 0xFF808000
 
constexpr Color LIME = 0xFF00FF00
 
constexpr Color GREEN = 0xFF008000
 
constexpr Color AQUA = 0xFF00FFFF
 
constexpr Color TEAL = 0xFF008080
 
constexpr Color BLUE = 0xFF0000FF
 
constexpr Color NAVY = 0xFF000080
 
constexpr Color FUCHSIA = 0xFFFF00FF
 
constexpr Color PURPLE = 0xFF800080
 
constexpr Color MAGENTA = 0xFFFF00FF
 
constexpr Color CYAN = 0xFF00FFFF
 
constexpr auto HTML_BASIC_COLORS
 W3C HTML 16 basic color list.
 

Typedef Documentation

◆ Color

typedef uint32_t UTILS::COLOR::Color

Function Documentation

◆ ChangeOpacity()

Color UTILS::COLOR::ChangeOpacity ( const Color argb,
const float opacity )

Change the opacity of a given ARGB color.

Parameters
colorThe original color
opacityThe opacity value as a float
Returns
the original color with the changed opacity/alpha value

◆ comparePairColorInfo()

bool UTILS::COLOR::comparePairColorInfo ( const std::pair< std::string, ColorInfo > & a,
const std::pair< std::string, ColorInfo > & b )

Comparer for pair string/ColorInfo to sort colors in a hue scale.

◆ ConvertHexToColor()

Color UTILS::COLOR::ConvertHexToColor ( const std::string & hexColor)

Convert given hex value to Color value.

Parameters
hexColorThe original hex color
Returns
the original hex color converted to Color value

◆ ConvertIntToRGB()

Color UTILS::COLOR::ConvertIntToRGB ( int r,
int g,
int b )

Convert given RGB int values to RGB color value.

Parameters
rThe red value
gThe green value
bThe blue value
Returns
the color as RGB value

◆ ConvertToARGB()

Color UTILS::COLOR::ConvertToARGB ( const Color rgba)

Convert given RGBA color to ARGB color value.

Parameters
colorThe original color
Returns
the original color converted to ARGB value

◆ ConvertToBGR()

Color UTILS::COLOR::ConvertToBGR ( const Color argb)

Convert given ARGB color to BGR color value.

Parameters
colorThe original color
Returns
the original color converted to BGR value

◆ ConvertToFloats()

ColorFloats UTILS::COLOR::ConvertToFloats ( const Color argb)

Convert given ARGB color to ColorFloats.

Parameters
colorThe original color
Returns
the original color converted to ColorFloats

◆ ConvertToHexRGB()

std::string UTILS::COLOR::ConvertToHexRGB ( const Color argb)

Convert given ARGB color to hex RGB color value.

Parameters
colorThe original color
Returns
The original color converted to hex RGB

◆ ConvertToRGBA()

Color UTILS::COLOR::ConvertToRGBA ( const Color argb)

Convert given ARGB color to RGBA color value.

Parameters
colorThe original color
Returns
the original color converted to RGBA value

◆ MakeColorInfo() [1/2]

ColorInfo UTILS::COLOR::MakeColorInfo ( const Color & argb)

Create a ColorInfo from an ARGB Color to get additional information of the color and allow to be sorted with a color comparer.

Parameters
argbThe original ARGB color
Returns
the ColorInfo

◆ MakeColorInfo() [2/2]

ColorInfo UTILS::COLOR::MakeColorInfo ( const std::string & hexColor)

Create a ColorInfo from an HEX color value to get additional information of the color and allow to be sorted with a color comparer.

Parameters
hexColorThe original ARGB color
Returns
the ColorInfo

Variable Documentation

◆ AQUA

Color UTILS::COLOR::AQUA = 0xFF00FFFF
constexpr

◆ BLACK

Color UTILS::COLOR::BLACK = 0xFF000000
constexpr

◆ BLUE

Color UTILS::COLOR::BLUE = 0xFF0000FF
constexpr

◆ CYAN

Color UTILS::COLOR::CYAN = 0xFF00FFFF
constexpr

◆ FUCHSIA

Color UTILS::COLOR::FUCHSIA = 0xFFFF00FF
constexpr

◆ GRAY

Color UTILS::COLOR::GRAY = 0xFF808080
constexpr

◆ GREEN

Color UTILS::COLOR::GREEN = 0xFF008000
constexpr

◆ HTML_BASIC_COLORS

auto UTILS::COLOR::HTML_BASIC_COLORS
constexpr
Initial value:
{"silver", SILVER},
{"gray", GRAY},
{"black", BLACK},
{"red", RED},
{"maroon", MAROON},
{"yellow", YELLOW},
{"olive", OLIVE},
{"lime", LIME},
{"green", GREEN},
{"aqua", AQUA},
{"teal", TEAL},
{"blue", BLUE},
{"navy", NAVY},
{"fuchsia", FUCHSIA},
{"purple", PURPLE}})
constexpr auto make_map(std::pair< Key, Value >(&&m)[Size]) -> CMap< Key, Value, Size >
Use this helper when wanting to use CMap. This is needed to allow deducing the size of the map from t...
Definition Map.h:99
@ WHITE
Definition cc_decoder.h:30
@ BLUE
Definition cc_decoder.h:32
@ GREEN
Definition cc_decoder.h:31
@ YELLOW
Definition cc_decoder.h:35
@ BLACK
Definition cc_decoder.h:37
@ RED
Definition cc_decoder.h:34
constexpr Color MAROON
Definition ColorUtils.h:37
constexpr Color LIME
Definition ColorUtils.h:40
constexpr Color TEAL
Definition ColorUtils.h:43
constexpr Color PURPLE
Definition ColorUtils.h:47
constexpr Color SILVER
Definition ColorUtils.h:33
constexpr Color AQUA
Definition ColorUtils.h:42
constexpr Color OLIVE
Definition ColorUtils.h:39
constexpr Color FUCHSIA
Definition ColorUtils.h:46
constexpr Color NAVY
Definition ColorUtils.h:45

W3C HTML 16 basic color list.

◆ LIME

Color UTILS::COLOR::LIME = 0xFF00FF00
constexpr

◆ LIMITED_BLACK

Color UTILS::COLOR::LIMITED_BLACK = 0xFF101010
constexpr

◆ MAGENTA

Color UTILS::COLOR::MAGENTA = 0xFFFF00FF
constexpr

◆ MAROON

Color UTILS::COLOR::MAROON = 0xFF800000
constexpr

◆ NAVY

Color UTILS::COLOR::NAVY = 0xFF000080
constexpr

◆ NONE

Color UTILS::COLOR::NONE = 0x00000000
constexpr

◆ OLIVE

Color UTILS::COLOR::OLIVE = 0xFF808000
constexpr

◆ PURPLE

Color UTILS::COLOR::PURPLE = 0xFF800080
constexpr

◆ RED

Color UTILS::COLOR::RED = 0xFFFF0000
constexpr

◆ SILVER

Color UTILS::COLOR::SILVER = 0xFFC0C0C0
constexpr

◆ TEAL

Color UTILS::COLOR::TEAL = 0xFF008080
constexpr

◆ WHITE

Color UTILS::COLOR::WHITE = 0xFFFFFFFF
constexpr

◆ YELLOW

Color UTILS::COLOR::YELLOW = 0xFFFFFF00
constexpr