Skylicht Engine
Loading...
Searching...
No Matches
Skylicht::CColor Class Reference

Utility functions for converting and parsing engine colors. More...

#include <Utils/CColor.h>

Static Public Member Functions

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.

Detailed Description

Utility functions for converting and parsing engine colors.

Member Function Documentation

◆ 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
hexHexadecimal 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
cInput color.
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
cInput color.
Returns
Converted color with the original alpha channel.

The documentation for this class was generated from the following file: