|
sandbox
|
RGBA color value type. More...
#include <color.hpp>
Public Member Functions | |
| color () noexcept | |
| Constructs a white color with full opacity. | |
| color (std::uint32_t rgba) noexcept | |
| Constructs a color from a packed 32-bit RGBA value. More... | |
| color (std::uint8_t red, std::uint8_t green, std::uint8_t blue, std::uint8_t alpha=255u) noexcept | |
| template<std::floating_point Type> | |
| color (Type red, Type green, Type blue, Type alpha=Type{1}) noexcept | |
| Constructs a color from individual components. More... | |
| auto | r () const noexcept -> const std::float_t & |
| Returns the red component (const). More... | |
| auto | r () noexcept -> std::float_t & |
| Returns the red component. More... | |
| auto | g () const noexcept -> const std::float_t & |
| Returns the green component (const). More... | |
| auto | g () noexcept -> std::float_t & |
| Returns the green component. More... | |
| auto | b () const noexcept -> const std::float_t & |
| Returns the blue component (const). More... | |
| auto | b () noexcept -> std::float_t & |
| Returns the blue component. More... | |
| auto | a () const noexcept -> const std::float_t & |
| Returns the alpha component (const). More... | |
| auto | a () noexcept -> std::float_t & |
| Returns the alpha component. More... | |
Static Public Member Functions | |
| static auto | black () noexcept -> color |
| Returns a black color. More... | |
| static auto | white () noexcept -> color |
| Returns a white color. More... | |
| static auto | red () noexcept -> color |
| Returns a red color. More... | |
| static auto | green () noexcept -> color |
| Returns a green color. More... | |
| static auto | blue () noexcept -> color |
| Returns a blue color. More... | |
| static auto | magenta () noexcept -> color |
| Returns a magenta color. More... | |
| static auto | yellow () noexcept -> color |
| Returns a yellow color. More... | |
| static auto | cyan () noexcept -> color |
| Returns a cyan color. More... | |
| static auto | orange () noexcept -> color |
| Returns an orange color. More... | |
RGBA color value type.
Represents a color using four floating-point components: red, green, blue, and alpha. Each component is expected to be in the range [0, 1].
The class is trivially copyable and designed for use in rendering pipelines, configuration files, and hashing contexts.
|
noexcept |
Constructs a color from a packed 32-bit RGBA value.
| rgba | Packed RGBA value in 0xRRGGBBAA layout. |
|
noexcept |
Constructs a color from individual components.
| red | Red component. |
| green | Green component. |
| blue | Blue component. |
| alpha | Alpha component. |
|
noexcept |
Returns the alpha component (const).
|
noexcept |
Returns the alpha component.
|
noexcept |
Returns the blue component (const).
|
noexcept |
Returns the blue component.
|
staticnoexcept |
Returns a black color.
|
staticnoexcept |
Returns a blue color.
|
staticnoexcept |
Returns a cyan color.
|
noexcept |
Returns the green component (const).
|
noexcept |
Returns the green component.
|
staticnoexcept |
Returns a green color.
|
staticnoexcept |
Returns a magenta color.
|
staticnoexcept |
Returns an orange color.
|
noexcept |
Returns the red component (const).
|
noexcept |
Returns the red component.
|
staticnoexcept |
Returns a red color.
|
staticnoexcept |
Returns a white color.
|
staticnoexcept |
Returns a yellow color.