MostlyHarmless 0.0.1
 
Loading...
Searching...
No Matches
mostly_harmless::gui::Colour Struct Referencefinal

Convenience struct representing a colour. More...

#include <mostlyharmless_Colour.h>

Public Member Functions

 Colour (std::uint32_t argb)
 
 Colour (std::uint8_t r_, std::uint8_t g_, std::uint8_t b_)
 
 Colour (std::uint8_t a_, std::uint8_t r_, std::uint8_t g_, std::uint8_t b_)
 

Public Attributes

std::uint8_t a
 
std::uint8_t r
 
std::uint8_t g
 
std::uint8_t b
 

Detailed Description

Convenience struct representing a colour.

Constructor & Destructor Documentation

◆ Colour() [1/3]

mostly_harmless::gui::Colour::Colour ( std::uint32_t argb)
explicit

Constructs a colour from an ARGB hex colour, in the format 0xAARRGGBB - for example, fully opaque red would be 0xFFFF0000

Parameters
argbThe hex code for the desired colour.

◆ Colour() [2/3]

mostly_harmless::gui::Colour::Colour ( std::uint8_t r_,
std::uint8_t g_,
std::uint8_t b_ )

Constructs a colour from individual (0 to 255) rgb args. In this overload, alpha defaults to 255.

Parameters
r_The 0 to 255 value for red.
g_The 0 to 255 value for green.
b_The 0 to 255 value for blue.

◆ Colour() [3/3]

mostly_harmless::gui::Colour::Colour ( std::uint8_t a_,
std::uint8_t r_,
std::uint8_t g_,
std::uint8_t b_ )

Constructs a colour from individual (0 to 255) argb args.

Parameters
a_The 0 to 255 value for alpha (255 being fully opaque)
r_The 0 to 255 value for red.
g_The 0 to 255 value for green.
b_The 0 to 255 value for blue.

Member Data Documentation

◆ a

std::uint8_t mostly_harmless::gui::Colour::a

◆ b

std::uint8_t mostly_harmless::gui::Colour::b

◆ g

std::uint8_t mostly_harmless::gui::Colour::g

◆ r

std::uint8_t mostly_harmless::gui::Colour::r

The documentation for this struct was generated from the following file: