Marbellous
Marbellous, a WebApp to generate paper marbling patterns.
Public Types | Public Member Functions | Friends | List of all members
Color Class Reference

A class representing a RGB color with a ratio. More...

#include <Color.hpp>

Collaboration diagram for Color:
Collaboration graph

Public Types

using rgb_t = std::tuple< uint8_t, uint8_t, uint8_t >
 

Public Member Functions

bool operator== (const Color &oth) const
 
 Color ()
 
 Color (uint8_t const red, uint8_t const green, uint8_t const blue)
 
 Color (unsigned const int color)
 
void set (uint8_t const red, uint8_t const green, uint8_t const blue)
 
void set (unsigned const int color)
 
rgb_t getRGB () const
 < get color channels More...
 

Friends

class Palette
 

Detailed Description

A class representing a RGB color with a ratio.

The ratio influences the drop rate of drops with this color when using the sprinkler.

Member Typedef Documentation

◆ rgb_t

using Color::rgb_t = std::tuple<uint8_t, uint8_t, uint8_t>

Constructor & Destructor Documentation

◆ Color() [1/3]

Color::Color ( )
inline

Construct black.

◆ Color() [2/3]

Color::Color ( uint8_t const  red,
uint8_t const  green,
uint8_t const  blue 
)
inline

Construct color by RGB values.

Parameters
rRed channel
gGreen channel
bBlue channel
Returns
Color Object

◆ Color() [3/3]

Color::Color ( unsigned const int  color)
inline

Construct a color object from HEX color code.

Parameters
cColor code given in HEX.

Member Function Documentation

◆ getRGB()

rgb_t Color::getRGB ( ) const
inline

< get color channels

Get the color values.

Returns
Color channels as tuple.
Here is the caller graph for this function:

◆ operator==()

bool Color::operator== ( const Color oth) const
inline

◆ set() [1/2]

void Color::set ( uint8_t const  red,
uint8_t const  green,
uint8_t const  blue 
)
inline

Set color via color channels.

Parameters
rRed channel
gGreen channel
bBlue channel

◆ set() [2/2]

void Color::set ( unsigned const int  color)
inline

Set color via HEX color code.

Parameters
cColor code given in HEX

Friends And Related Function Documentation

◆ Palette

friend class Palette
friend

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