|
SleakEngine 1.0.0
C++23 multi-backend game engine
|
#include <Color.hpp>
Public Member Functions | |
| constexpr | Color ()=default |
| constexpr | Color (uint8_t r, uint8_t g, uint8_t b, uint8_t a=255) noexcept |
| constexpr Color | clamped () const noexcept |
| Clamps every channel into [0, 255]. | |
| uint8_t | GetA () const |
| uint8_t | GetB () const |
| uint8_t | GetG () const |
| uint8_t | GetR () const |
| Color | linearToSrgb () const noexcept |
| Vector4D | normalize () const noexcept |
| Converts to a Vector4D with each channel in [0,1]. | |
| constexpr bool | operator!= (const Color &other) const noexcept |
| constexpr Color | operator* (float scalar) const noexcept |
| constexpr Color | operator+ (const Color &other) const noexcept |
| constexpr bool | operator== (const Color &other) const noexcept |
| Color | premultiplied () const noexcept |
| Scales RGB by alpha, for premultiplied-alpha blending. | |
| Color | srgbToLinear () const noexcept |
| std::string | toString () const |
| constexpr Color | withAlpha (uint8_t newAlpha) const noexcept |
| Returns a copy with alpha replaced. | |
Static Public Member Functions | |
| static Color | fromHex (uint32_t hex) noexcept |
| Builds a color from a 0xRRGGBB or 0xAARRGGBB packed value. | |
| static Color | fromHSV (float h, float s, float v, uint8_t a=255) noexcept |
| Builds a color from hue/saturation/value in [0,1]. | |
Static Public Attributes | |
| static const Color | Black |
| static const Color | Blue |
| static const Color | Green |
| static const Color | Red |
| static const Color | Transparent |
| static const Color | White |
8-bit RGBA color. Value type, cheap to pass and store on vertices/UI.
|
constexprdefault |
|
inlineconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
staticnodiscardnoexcept |
|
staticnodiscardnoexcept |
|
nodiscardnoexcept |
|
inlinenodiscardnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
nodiscardnoexcept |
|
nodiscardnoexcept |
|
inlinenodiscard |
|
inlinenodiscardconstexprnoexcept |