Utility functions for converting and parsing engine colors.
More...
#include <Utils/CColor.h>
|
| static SColor | toSRGB (const SColor &c) |
| | Apply a 2.2 gamma exponent to the RGB channels.
|
| static SColor | toLinear (const SColor &c) |
| | Apply an inverse 2.2 gamma exponent to the RGB channels.
|
| static SColor | fromHex (const char *hex) |
| | Parse a hexadecimal color string.
|
Utility functions for converting and parsing engine colors.
◆ fromHex()
| SColor Skylicht::CColor::fromHex |
( |
const char * | hex | ) |
|
|
static |
Parse a hexadecimal color string.
Supports RRGGBB and AARRGGBB strings without a leading #. Invalid lengths return opaque white.
- Parameters
-
| hex | Hexadecimal color text. |
- Returns
- Parsed color.
◆ toLinear()
| SColor Skylicht::CColor::toLinear |
( |
const SColor & | c | ) |
|
|
static |
Apply an inverse 2.2 gamma exponent to the RGB channels.
- Parameters
-
- Returns
- Converted color with the original alpha channel.
◆ toSRGB()
| SColor Skylicht::CColor::toSRGB |
( |
const SColor & | c | ) |
|
|
static |
Apply a 2.2 gamma exponent to the RGB channels.
- Parameters
-
- Returns
- Converted color with the original alpha channel.
The documentation for this class was generated from the following file: