morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::ui::Rgba Struct Reference

A colour, 8 bits per channel. More...

#include <theme.hpp>

Public Member Functions

bool operator== (Rgba const &) const =default
 Field-wise equality.
std::string hex () const
 The colour as #rrggbb, or #rrggbbaa when it is not opaque.

Public Attributes

std::uint8_t r = 0
 Red.
std::uint8_t g = 0
 Green.
std::uint8_t b = 0
 Blue.
std::uint8_t a = 255
 Alpha; 255 is opaque.

Detailed Description

A colour, 8 bits per channel.

Definition at line 102 of file theme.hpp.

Member Function Documentation

◆ operator==()

bool morph::ui::Rgba::operator== ( Rgba const & ) const
default

Field-wise equality.

Returns
Whether every channel is equal.

◆ hex()

std::string morph::ui::Rgba::hex ( ) const
inlinenodiscard

The colour as #rrggbb, or #rrggbbaa when it is not opaque.

Returns
The text.

Definition at line 118 of file theme.hpp.

Member Data Documentation

◆ r

std::uint8_t morph::ui::Rgba::r = 0

Red.

Definition at line 104 of file theme.hpp.

◆ g

std::uint8_t morph::ui::Rgba::g = 0

Green.

Definition at line 106 of file theme.hpp.

◆ b

std::uint8_t morph::ui::Rgba::b = 0

Blue.

Definition at line 108 of file theme.hpp.

◆ a

std::uint8_t morph::ui::Rgba::a = 255

Alpha; 255 is opaque.

Definition at line 110 of file theme.hpp.


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