25[[nodiscard]]
constexpr Color rgb(std::uint32_t hex,
float alpha = 1.0F) noexcept {
26 constexpr float max = 255.0F;
27 return {.
r =
static_cast<float>((hex >> 16U) & 0xFFU) / max,
28 .g =
static_cast<float>((hex >> 8U) & 0xFFU) / max,
29 .b =
static_cast<float>(hex & 0xFFU) / max,
OpenGL renderer: sprites, text and camera (client only).
Definition bitmap_font.hpp:16
constexpr Color rgb(std::uint32_t hex, float alpha=1.0F) noexcept
Color from its hexadecimal sRGB code, as design tools and palettes give it.
Definition color.hpp:25
RGBA color with components in [0, 1].
Definition color.hpp:10
float a
Alpha component, 1 for opaque.
Definition color.hpp:18
float g
Green component.
Definition color.hpp:14
float b
Blue component.
Definition color.hpp:16
float r
Red component.
Definition color.hpp:12