Skip to content

Class daisy::Color

ClassList > daisy > Color

More...

  • #include <color.h>

Public Types

Type Name
enum PresetColor

Public Functions

Type Name
float Blue () const
uint8_t Blue8 () const
Color ()
Color (float r, float g, float b)
float Green () const
uint8_t Green8 () const
void Init (PresetColor c)
void Init (float red, float green, float blue)
float Red () const
uint8_t Red8 () const
void SetBlue (const float amt)
void SetGreen (const float amt)
void SetRed (const float amt)
Color operator* (float scale)
Color operator+ (Color rhs)
~Color ()

Public Static Functions

Type Name
Color Blend (const Color a, const Color b, const float amt)

Detailed Description

Class for handling simple colors

Public Types Documentation

enum PresetColor

enum daisy::Color::PresetColor {
    RED,
    GREEN,
    BLUE,
    WHITE,
    PURPLE,
    CYAN,
    GOLD,
    OFF,
    LAST
};

List of colors that have a preset RGB value


Public Functions Documentation

function Blue

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

Returns the 0-1 value for Blue


function Blue8

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

function Color [½]

inline daisy::Color::Color () 

function Color [2/2]

inline daisy::Color::Color (
    float r,
    float g,
    float b
) 

function Green

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

Returns the 0-1 value for Green


function Green8

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

function Init [½]

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

Initializes the Color with a given preset.

Parameters:


function Init [2/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:

  • red Red value
  • green Green value
  • blue Blue value

function Red

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

Returns the 0-1 value for Red


function Red8

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

function SetBlue

inline void daisy::Color::SetBlue (
    const  float amt
) 

function SetGreen

inline void daisy::Color::SetGreen (
    const  float amt
) 

function SetRed

inline void daisy::Color::SetRed (
    const  float amt
) 

function operator*

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

Returns a scaled color by a float


function operator+

inline Color daisy::Color::operator+ (
    Color rhs
) 

Adds another color to this one, destructively saturating at 1


function ~Color

inline daisy::Color::~Color () 

Public Static Functions Documentation

function Blend

static inline Color daisy::Color::Blend (
    const  Color a,
    const  Color b,
    const  float amt
) 

Returns a color that is blended between a and b



The documentation for this class was generated from the following file external-docs/libDaisy/src/util/color.h