A toolkit for working with phylogenetic data.
v0.18.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Color Class Reference

#include <genesis/utils/tools/color.hpp>

Detailed Description

Definition at line 47 of file color.hpp.

Public Member Functions

 Color ()
 Default constructor. Sets the color to black. More...
 
 Color (double r, double g, double b)
 Constructor for setting the RGB value. More...
 
 Color (double r, double g, double b, double a)
 Constructor for setting the RGB value including alpha. More...
 
 Color (Color const &)=default
 
 Color (Color &&) noexcept=default
 
 ~Color ()=default
 
double a () const
 
void a (double value)
 
unsigned char a_byte () const
 
void a_byte (unsigned char value)
 
double b () const
 
void b (double value)
 
unsigned char b_byte () const
 
void b_byte (unsigned char value)
 
double g () const
 
void g (double value)
 
unsigned char g_byte () const
 
void g_byte (unsigned char value)
 
Coloroperator= (Color const &)=default
 
Coloroperator= (Color &&) noexcept=default
 
double r () const
 
void r (double value)
 
unsigned char r_byte () const
 
void r_byte (unsigned char value)
 
void swap (Color &other) noexcept
 

Static Public Member Functions

static Color from_bytes (unsigned char r, unsigned char g, unsigned char b, unsigned char a=255)
 
static Color from_hex (std::string const &hex_color, std::string const &prefix="#")
 

Constructor & Destructor Documentation

Color ( )
inline

Default constructor. Sets the color to black.

Definition at line 58 of file color.hpp.

Color ( double  r,
double  g,
double  b 
)
inline

Constructor for setting the RGB value.

Definition at line 65 of file color.hpp.

Color ( double  r,
double  g,
double  b,
double  a 
)

Constructor for setting the RGB value including alpha.

Definition at line 46 of file color.cpp.

~Color ( )
default
Color ( Color const &  )
default
Color ( Color &&  )
defaultnoexcept

Member Function Documentation

double a ( ) const
inline

Definition at line 118 of file color.hpp.

void a ( double  value)

Definition at line 104 of file color.cpp.

unsigned char a_byte ( ) const
inline

Definition at line 138 of file color.hpp.

void a_byte ( unsigned char  value)
inline

Definition at line 170 of file color.hpp.

double b ( ) const
inline

Definition at line 113 of file color.hpp.

void b ( double  value)

Definition at line 94 of file color.cpp.

unsigned char b_byte ( ) const
inline

Definition at line 133 of file color.hpp.

void b_byte ( unsigned char  value)
inline

Definition at line 165 of file color.hpp.

Color from_bytes ( unsigned char  r,
unsigned char  g,
unsigned char  b,
unsigned char  a = 255 
)
static

Definition at line 60 of file color.cpp.

Color from_hex ( std::string const &  hex_color,
std::string const &  prefix = "#" 
)
static

Definition at line 65 of file color.cpp.

double g ( ) const
inline

Definition at line 108 of file color.hpp.

void g ( double  value)

Definition at line 84 of file color.cpp.

unsigned char g_byte ( ) const
inline

Definition at line 128 of file color.hpp.

void g_byte ( unsigned char  value)
inline

Definition at line 160 of file color.hpp.

Color& operator= ( Color const &  )
default
Color& operator= ( Color &&  )
defaultnoexcept
double r ( ) const
inline

Definition at line 103 of file color.hpp.

void r ( double  value)

Definition at line 74 of file color.cpp.

unsigned char r_byte ( ) const
inline

Definition at line 123 of file color.hpp.

void r_byte ( unsigned char  value)
inline

Definition at line 155 of file color.hpp.

void swap ( Color other)
inlinenoexcept

Definition at line 82 of file color.hpp.


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