24 Colour::Colour(
const std::uint8_t r,
const std::uint8_t g,
const std::uint8_t b,
const std::uint8_t a)
noexcept
34 this->m_red = c.m_red;
35 this->m_green = c.m_green;
36 this->m_blue = c.m_blue;
37 this->m_alpha = c.m_alpha;
42 this->m_red = c.m_red;
43 this->m_green = c.m_green;
44 this->m_blue = c.m_blue;
45 this->m_alpha = c.m_alpha;
52 this->m_red = c.m_red;
53 this->m_green = c.m_green;
54 this->m_blue = c.m_blue;
55 this->m_alpha = c.m_alpha;
65 this->m_red = c.m_red;
66 this->m_green = c.m_green;
67 this->m_blue = c.m_blue;
68 this->m_alpha = c.m_alpha;
80 m_red = std::clamp(r, LOWER, UPPER);
85 m_green = std::clamp(g, LOWER, UPPER);
90 m_blue = std::clamp(b, LOWER, UPPER);
95 m_alpha = std::clamp(a, LOWER, UPPER);
120 m_red = std::clamp(
static_cast<std::uint8_t
>(rgba.x * OFFSET), LOWER, UPPER);
121 m_green = std::clamp(
static_cast<std::uint8_t
>(rgba.y * OFFSET), LOWER, UPPER);
122 m_blue = std::clamp(
static_cast<std::uint8_t
>(rgba.z * OFFSET), LOWER, UPPER);
123 m_alpha = std::clamp(
static_cast<std::uint8_t
>(rgba.w * OFFSET), LOWER, UPPER);
128 auto vec4 = glm::vec4();
Represents an RGBA colour.
Colour & operator=(Colour &&) noexcept
Move assignment operator.
std::array< std::uint8_t, 4 > array() noexcept
Get as array.
std::uint8_t m_blue
Blue channel.
std::uint8_t m_alpha
Alpha channel.
std::uint8_t a() const noexcept
Get alpha.
std::uint8_t m_red
Red channel.
glm::vec4 normalize() noexcept
Get normalized rgba vec4.
void set_from_norm(const glm::vec4 &rgba) noexcept
Set RGBA from normalizaed values.
Colour() noexcept
Constructor.
std::uint8_t b() const noexcept
Get blue.
std::uint8_t r() const noexcept
Get red.
std::uint8_t g() const noexcept
Get green.
~Colour() noexcept
Destructor.
std::uint8_t m_green
Green channel.
static const constexpr std::uint8_t OFFSET
Colour offsets for normalization.
float constexpr normalize(const Arithmetic val, const Arithmetic max) noexcept
Calc normalized value from range.