trase
trase::RGBA Class Reference

Colour class with red, green, blue and alpha in range 0 to 255. More...

#include <Colors.hpp>

Collaboration diagram for trase::RGBA:

Public Member Functions

 RGBA ()=default
 default constructor
 
 RGBA (int r, int g, int b, int a=default_alpha) noexcept
 constructor taking red, green, blue and alpha
 
 RGBA (const Vector< float, 4 > &v) noexcept
 constructor taking 4 float vector
 
 RGBA (const Vector< float, 3 > &v) noexcept
 constructor taking 3 float vector
 
 operator Vector< float, 4 > () const noexcept
 convert to an float vector
 
std::string to_rgb_string () const noexcept
 convert to an rgb string of form #rrggbb
 
int r () const noexcept
 Get the current red value.
 
int g () const noexcept
 Get the current green value.
 
int b () const noexcept
 Get the current blue value.
 
int a () const noexcept
 Get the current alpha value.
 
RGBAr (int r) noexcept
 Set a new red value.
 
RGBAg (int g) noexcept
 Set a new green value.
 
RGBAb (int b) noexcept
 Set a new blue value.
 
RGBAa (int a) noexcept
 Set a new alpha value.
 
bool operator== (const RGBA &b) const noexcept
 Equality comparison.
 
bool operator!= (const RGBA &b) const noexcept
 

Static Public Attributes

static const int default_alpha = 200
 
static const std::array< const RGBA, 10 > defaults
 
static const RGBA black {0, 0, 0}
 
static const RGBA white {255, 255, 255}
 

Detailed Description

Colour class with red, green, blue and alpha in range 0 to 255.

Member Data Documentation

◆ defaults

const std::array< const RGBA, 10 > trase::RGBA::defaults
static
Initial value:
= {
RGBA{31, 119, 180}, RGBA{255, 127, 14}, RGBA{44, 160, 44},
RGBA{214, 39, 40}, RGBA{148, 103, 189}, RGBA{140, 86, 75},
RGBA{227, 119, 194}, RGBA{127, 127, 127}, RGBA{188, 189, 34},
RGBA{23, 190, 207}}

The documentation for this class was generated from the following files: