HOG2
Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Static Private Member Functions | List of all members
rgbColor Class Reference

A color; r/g/b are between 0...1. More...

#include <Colors.h>

Public Member Functions

 rgbColor ()
 
 rgbColor (float rr, float gg, float bb)
 
rgbColoroperator= (const rgbColor &)=default
 
rgbColoroperator*= (float p)
 
rgbColor operator* (float p) const
 
rgbColor operator+ (const rgbColor &c) const
 
void mix (const rgbColor &c, float perc)
 
std::string hex () const
 
void hex (const char *str)
 

Static Public Member Functions

static rgbColor mix (const rgbColor &c1, const rgbColor &c2, float perc)
 
static rgbColor hsl (float h, float s, float l)
 

Public Attributes

float r
 
float g
 
float b
 

Private Member Functions

int unhexdigit (char c)
 

Static Private Member Functions

static float hue2rgb (float p, float q, float t)
 

Detailed Description

A color; r/g/b are between 0...1.

Definition at line 17 of file Colors.h.

Constructor & Destructor Documentation

◆ rgbColor() [1/2]

rgbColor::rgbColor ( )
inline

Definition at line 19 of file Colors.h.

Referenced by hsl(), and mix().

◆ rgbColor() [2/2]

rgbColor::rgbColor ( float  rr,
float  gg,
float  bb 
)
inline

Definition at line 20 of file Colors.h.

Member Function Documentation

◆ hex() [1/2]

std::string rgbColor::hex ( ) const
inline

◆ hex() [2/2]

void rgbColor::hex ( const char *  str)
inline

Definition at line 60 of file Colors.h.

References b, g, r, and unhexdigit().

◆ hsl()

static rgbColor rgbColor::hsl ( float  h,
float  s,
float  l 
)
inlinestatic

Definition at line 29 of file Colors.h.

References b, g, hue2rgb(), r, and rgbColor().

Referenced by HexagonEnvironment::Draw(), and Hexagon::Load().

◆ hue2rgb()

static float rgbColor::hue2rgb ( float  p,
float  q,
float  t 
)
inlinestaticprivate

Definition at line 73 of file Colors.h.

Referenced by hsl().

◆ mix() [1/2]

void rgbColor::mix ( const rgbColor c,
float  perc 
)
inline

Definition at line 46 of file Colors.h.

References b, g, and r.

◆ mix() [2/2]

static rgbColor rgbColor::mix ( const rgbColor c1,
const rgbColor c2,
float  perc 
)
inlinestatic

◆ operator*()

rgbColor rgbColor::operator* ( float  p) const
inline

Definition at line 23 of file Colors.h.

◆ operator*=()

rgbColor& rgbColor::operator*= ( float  p)
inline

Definition at line 22 of file Colors.h.

References b, g, and r.

◆ operator+()

rgbColor rgbColor::operator+ ( const rgbColor c) const
inline

Definition at line 24 of file Colors.h.

References mix().

◆ operator=()

rgbColor& rgbColor::operator= ( const rgbColor )
default

◆ unhexdigit()

int rgbColor::unhexdigit ( char  c)
inlineprivate

Definition at line 83 of file Colors.h.

Referenced by hex().

Member Data Documentation

◆ b

float rgbColor::b

◆ g

float rgbColor::g

◆ r

float rgbColor::r

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