libDaisy
Hardware Library for Daisy
Loading...
Searching...
No Matches
daisy::Color Class Reference

Detailed Description

Class for handling simple colors

#include <color.h>

Public Types

enum  PresetColor {
  RED , GREEN , BLUE , WHITE ,
  PURPLE , CYAN , GOLD , OFF ,
  LAST
}
 

Public Member Functions

 Color ()
 
 ~Color ()
 
void Init (PresetColor c)
 
void Init (float red, float green, float blue)
 
float Red () const
 
float Green () const
 
float Blue () const
 
uint8_t Red8 () const
 
uint8_t Green8 () const
 
uint8_t Blue8 () const
 
Color operator* (float scale)
 

Member Enumeration Documentation

◆ PresetColor

List of colors that have a preset RGB value

Enumerator
RED 

&

GREEN 

&

BLUE 

&

WHITE 

&

PURPLE 

&

CYAN 

&

GOLD 

&

OFF 

&

LAST 

&

Constructor & Destructor Documentation

◆ Color()

daisy::Color::Color ( )
inline

◆ ~Color()

daisy::Color::~Color ( )
inline

Member Function Documentation

◆ Blue()

float daisy::Color::Blue ( ) const
inline

Returns the 0-1 value for Blue

◆ Blue8()

uint8_t daisy::Color::Blue8 ( ) const
inline

◆ Green()

float daisy::Color::Green ( ) const
inline

Returns the 0-1 value for Green

◆ Green8()

uint8_t daisy::Color::Green8 ( ) const
inline

◆ Init() [1/2]

void daisy::Color::Init ( float  red,
float  green,
float  blue 
)

Initializes the Color with a specific RGB value red, green, and blue should be floats between 0 and 1

Parameters
redRed value
greenGreen value
blueBlue value

◆ Init() [2/2]

void daisy::Color::Init ( PresetColor  c)

Initializes the Color with a given preset.

Parameters
cColor to init to

◆ operator*()

Color daisy::Color::operator* ( float  scale)
inline

Returns a scaled color by a float

◆ Red()

float daisy::Color::Red ( ) const
inline

Returns the 0-1 value for Red

◆ Red8()

uint8_t daisy::Color::Red8 ( ) const
inline

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