NSUNI/NSLAR Library a250670
Loading...
Searching...
No Matches
nnl::utl::color Namespace Reference

Provides functions for color conversion and manipulation. More...

Functions

u8 Convert4To8 (u8 v) noexcept
 Converts a 4-bit color channel value to an 8-bit color channel value.
u8 Convert5To8 (u8 v) noexcept
 Converts a 5-bit color channel value to an 8-bit color channel value.
u8 Convert6To8 (u8 v) noexcept
 Converts a 6-bit color channel value to an 8-bit color channel value.
u32 RGBA4444ToRGBA8888 (u16 src) noexcept
 Converts RGBA4444 color format to RGBA8888 color format.
u32 RGBA5551ToRGBA8888 (u16 src) noexcept
 Converts RGBA5551 color format to RGBA8888 color format.
u32 RGB565ToRGBA8888 (u16 src) noexcept
 Converts RGB565 color format to RGBA8888 color format.
u16 RGBA8888ToRGB565 (u32 value) noexcept
 Converts RGBA8888 color format to RGB565 color format.
u16 RGBA8888ToRGBA5551 (u32 value) noexcept
 Converts RGBA8888 color format to RGBA5551 color format.
u16 RGBA8888ToRGBA4444 (u32 value) noexcept
 Converts RGBA8888 color format to RGBA4444 color format.
std::string IntToHex (u32 color, bool alpha=true)
 Converts an integer color value to a hex string representation.
u32 HexToInt (std::string hex)
 Converts a hex string representation of a color to an integer color value.
glm::vec4 IntToFloat (u32 color) noexcept
 Converts an integer color value to a floating-point vector representation.
u8 FloatToInt (float color) noexcept
 Converts a floating-point color value to an integer color representation.
u32 FloatToInt (glm::vec3 color) noexcept
 Converts a vec3 floating-point color vector to an integer color representation.
u32 FloatToInt (glm::vec4 color)
 Converts a vec4 floating-point color vector to an integer color representation.
float SRGBToLinear (float c) noexcept
 Converts an sRGB color value to a linear color value.
template<typename T>
SRGBToLinear (T color)
 Converts a vec of sRGB color values to linear color values.
float LinearToSRGB (float c) noexcept
 Converts a linear color value to an sRGB color value.
template<typename T>
LinearToSRGB (T color)
 Converts a vector of linear color values to sRGB color values.

Detailed Description

Provides functions for color conversion and manipulation.