NSUNI/NSLAR Library a250670
Loading...
Searching...
No Matches
color.hpp File Reference

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

#include <glm/glm.hpp>
#include "NNL/common/fixed_type.hpp"
#include "NNL/utility/data.hpp"
#include "NNL/utility/string.hpp"

Go to the source code of this file.

Namespaces

namespace  nnl
namespace  nnl::utl::color
 Provides functions for color conversion and manipulation.

Functions

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

Detailed Description

Provides functions for color conversion and manipulation.