Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
|
Functions | |
std::string | colorToHex (iv::types::color value, const bool hasAlpha) |
std::optional< iv::types::color > | hexToColor (const std::string_view hex) |
double | getAlpha (const iv::types::color hexValue) |
iv::types::color | removeAlpha (const iv::types::color hexValue) |
iv::types::color | colorBorder (const iv::types::color colorState) |
Provides a border color. | |
static void | prvGetRGB (const uint32_t rgb, double *r, double *g, double *b) |
Private function that gets the RGB's values by parameters. | |
void | prvDarkenColor (const double r, const double g, const double b, const double factorDarken, double *rDarken, double *gDarken, double *bDarken) |
Private function that darken the RGB colors. | |
uint32_t | darkenColorRgb (const uint32_t rgb, const double factorDarken) |
Get a darker version of the given RGB. | |
iv::types::color | darkenColorArgb (const iv::types::color argb, const double factorDarken) |
void | prvIlluminateColor (const double r, const double g, const double b, const double factorIlluminate, double *rIlluminate, double *gIlluminate, double *bIlluminate) |
Private Function that illuminate the RGB color given. | |
iv::types::color | illuminateColorRgb (const iv::types::color rgb, const double factorIlluminate) |
Get a brighter version of the given RGB. | |
bool | isDarkColorRgb (const uint32_t rgb) |
Check if the provided RGB is dark. | |
bool | isIlluminateColorRgb (const uint32_t rgb) |
Check if the provided RGB is illuminated. | |
template<typename T > requires ((std::is_floating_point_v<T> && std::numeric_limits<T>::is_iec559 && (std::numeric_limits<T>::radix == 2)) || (std::is_unsigned_v<T> && sizeof(T) == 1)) | |
iv::types::color | compactRgb (T r, T g, T b, T a) |
Returns an ARGB value according to the values given as unsigned char. | |
template<typename T > requires ((std::is_floating_point_v<T> && std::numeric_limits<T>::is_iec559 && (std::numeric_limits<T>::radix == 2)) || (std::is_unsigned_v<T> && sizeof(T) == 1)) | |
iv::types::color | compactRgb (T r, T g, T b) |
Returns an ARGB value according to the values given as unsigned char. | |
template<typename T > requires ((std::is_floating_point_v<T> && std::numeric_limits<T>::is_iec559 && (std::numeric_limits<T>::radix == 2)) || (std::is_unsigned_v<T> && sizeof(T) == 1)) | |
void | hexToBgr (iv::types::color hexValue, T *b_out, T *g_out, T *r_out, std::optional< T > alpha_out=std::nullopt) |
template<typename T > requires ((std::is_floating_point_v<T> && std::numeric_limits<T>::is_iec559 && (std::numeric_limits<T>::radix == 2)) || (std::is_unsigned_v<T> && sizeof(T) == 1)) | |
void | hexToRgb (iv::types::color hexValue, T *r_out, T *g_out, T *b_out, std::optional< std::reference_wrapper< T > > alpha_out=std::nullopt) |
template<typename T > requires ((std::is_floating_point_v<T> && std::numeric_limits<T>::is_iec559 && (std::numeric_limits<T>::radix == 2)) || (std::is_unsigned_v<T> && sizeof(T) == 1)) | |
void | rgbToHex (T r, T g, T b, T alpha, iv::types::color *hexValue_out) |
template<typename T > requires ((std::is_floating_point_v<T> && std::numeric_limits<T>::is_iec559 && (std::numeric_limits<T>::radix == 2)) || (std::is_unsigned_v<T> && sizeof(T) == 1)) | |
iv::types::color | addAlpha (iv::types::color hexValue, T alpha) |
template<typename T > requires ((std::is_floating_point_v<T> && std::numeric_limits<T>::is_iec559 && (std::numeric_limits<T>::radix == 2)) || (std::is_unsigned_v<T> && sizeof(T) == 1)) | |
iv::types::color | changeAlpha (iv::types::color hexValue, T alpha) |
void | getRgb2Char (iv::types::color color, unsigned char *r, unsigned char *g, unsigned char *b) |
Get unsigned char values from a 2 Bytes color. | |
iv::types::color iv::color::utils::addAlpha | ( | iv::types::color | hexValue, |
T | alpha ) |
iv::types::color iv::color::utils::changeAlpha | ( | iv::types::color | hexValue, |
T | alpha ) |
iv::types::color iv::color::utils::colorBorder | ( | const iv::types::color | colorState | ) |
Provides a border color.
colorState | The color state |
std::string iv::color::utils::colorToHex | ( | iv::types::color | value, |
const bool | hasAlpha ) |
iv::types::color iv::color::utils::compactRgb | ( | T | r, |
T | g, | ||
T | b ) |
Returns an ARGB value according to the values given as unsigned char.
r | The red value |
g | The green value |
b | The blue value |
iv::types::color iv::color::utils::compactRgb | ( | T | r, |
T | g, | ||
T | b, | ||
T | a ) |
Returns an ARGB value according to the values given as unsigned char.
r | The red value |
g | The green value |
b | The blue value |
a | The alpha value |
iv::types::color iv::color::utils::darkenColorArgb | ( | const iv::types::color | argb, |
const double | factorDarken ) |
uint32_t iv::color::utils::darkenColorRgb | ( | const uint32_t | rgb, |
const double | factorDarken ) |
Get a darker version of the given RGB.
rgb | The initial RGB to modify |
factorDarken | The dark factor |
double iv::color::utils::getAlpha | ( | const iv::types::color | hexValue | ) |
void iv::color::utils::getRgb2Char | ( | iv::types::color | color, |
unsigned char * | r, | ||
unsigned char * | g, | ||
unsigned char * | b ) |
Get unsigned char values from a 2 Bytes color.
color | The given 2 Bytes color |
r | The variable where save the Red value |
g | The variable where save the Green value |
b | The variable where save the Blue value |
void iv::color::utils::hexToBgr | ( | iv::types::color | hexValue, |
T * | b_out, | ||
T * | g_out, | ||
T * | r_out, | ||
std::optional< T > | alpha_out = std::nullopt ) |
std::optional< iv::types::color > iv::color::utils::hexToColor | ( | const std::string_view | hex | ) |
void iv::color::utils::hexToRgb | ( | iv::types::color | hexValue, |
T * | r_out, | ||
T * | g_out, | ||
T * | b_out, | ||
std::optional< std::reference_wrapper< T > > | alpha_out = std::nullopt ) |
iv::types::color iv::color::utils::illuminateColorRgb | ( | const iv::types::color | rgb, |
const double | factorIlluminate ) |
Get a brighter version of the given RGB.
rgb | The initial RGB to modify |
factorIlluminate | The illuminate factor |
bool iv::color::utils::isDarkColorRgb | ( | const uint32_t | rgb | ) |
Check if the provided RGB is dark.
rgb | The provided RGB color |
bool iv::color::utils::isIlluminateColorRgb | ( | const uint32_t | rgb | ) |
Check if the provided RGB is illuminated.
rgb | The provided RGB color |
void iv::color::utils::prvDarkenColor | ( | const double | r, |
const double | g, | ||
const double | b, | ||
const double | factorDarken, | ||
double * | rDarken, | ||
double * | gDarken, | ||
double * | bDarken ) |
Private function that darken the RGB colors.
r | The initial Red value |
g | The initial Green value |
b | The initial Blue value |
factorDarken | The Darken factor (between 0 and 1) |
rDarken | The resultant Red value |
gDarken | The resultant Green value |
bDarken | The resultant Blue value |
|
static |
Private function that gets the RGB's values by parameters.
rgb | The given RGB value |
r | The variable where save the Red value |
g | The variable where save the Green value |
b | The variable where save the Blue value |
void iv::color::utils::prvIlluminateColor | ( | const double | r, |
const double | g, | ||
const double | b, | ||
const double | factorIlluminate, | ||
double * | rIlluminate, | ||
double * | gIlluminate, | ||
double * | bIlluminate ) |
Private Function that illuminate the RGB color given.
r | The initial Red value |
g | The initial Green value |
b | The initial Blue value |
factorIlluminate | The Illuminate factor |
rIlluminate | The resultant Red value |
gIlluminate | The resultant Green value |
bIlluminate | The resultant Blue value |
iv::types::color iv::color::utils::removeAlpha | ( | const iv::types::color | hexValue | ) |
void iv::color::utils::rgbToHex | ( | T | r, |
T | g, | ||
T | b, | ||
T | alpha, | ||
iv::types::color * | hexValue_out ) |