pixled-lib  1.0
Classes | Public Member Functions | Static Public Member Functions | List of all members
pixled::color Class Reference

#include <color.h>

Public Member Functions

uint8_t red () const
 
uint8_t green () const
 
uint8_t blue () const
 
float hue () const
 
float saturation () const
 
float brightness () const
 
colorsetRgb (uint8_t r, uint8_t g, uint8_t b)
 
colorsetRed (uint8_t r)
 
colorsetGreen (uint8_t g)
 
colorsetBlue (uint8_t b)
 
colorsetHsb (float h, float s, float b)
 
colorsetHue (float h)
 
colorsetSaturation (float s)
 
colorsetBrightness (float b)
 

Static Public Member Functions

static color rgb (uint8_t r, uint8_t g, uint8_t b)
 
static color hsb (float h, float s, float b)
 

Detailed Description

Fundamental type representing a color.

Member Function Documentation

◆ red()

uint8_t pixled::color::red ( ) const
inline

Red color component, in [0, 255].

◆ green()

uint8_t pixled::color::green ( ) const
inline

Green color component, in [0, 255].

◆ blue()

uint8_t pixled::color::blue ( ) const
inline

Blue color component, in [0, 255].

◆ hue()

float pixled::color::hue ( ) const
inline

Hue, in [0, 360].

◆ saturation()

float pixled::color::saturation ( ) const
inline

Saturation, in [0, 1].

◆ brightness()

float pixled::color::brightness ( ) const
inline

Brightness, in [0, 1].

◆ setRgb()

color & pixled::color::setRgb ( uint8_t  r,
uint8_t  g,
uint8_t  b 
)

Sets the RGB values of this color.

Parameters
rred
ggreen
bblue

◆ setRed()

color & pixled::color::setRed ( uint8_t  r)

Sets the Red component value of this color.

Parameters
rred

◆ setGreen()

color & pixled::color::setGreen ( uint8_t  g)

Sets the Green component value of this color.

Parameters
ggreen

◆ setBlue()

color & pixled::color::setBlue ( uint8_t  b)

Sets the Blue component value of this color.

Parameters
bblue

◆ setHsb()

color & pixled::color::setHsb ( float  h,
float  s,
float  b 
)

Sets the HSB values of this color.

Parameters
hhue
ssaturation
bbrightness

◆ setHue()

color & pixled::color::setHue ( float  h)

Sets the hue of this color.

Parameters
hhue

◆ setSaturation()

color & pixled::color::setSaturation ( float  s)

Sets the saturation of this color.

Parameters
ssaturation.

◆ setBrightness()

color & pixled::color::setBrightness ( float  b)

Sets the brightness of this color.

Parameters
bbrightness.

◆ rgb()

color pixled::color::rgb ( uint8_t  r,
uint8_t  g,
uint8_t  b 
)
static

Builds a color instance from RGB values.

Parameters
rred
ggreen
bblue
Returns
color instance

◆ hsb()

color pixled::color::hsb ( float  h,
float  s,
float  b 
)
static

Builds a color instance from HSB values.

Parameters
hhue
ssaturation
bbrightness
Returns
color instance

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