Skip to content

daisy::Color

Module: LIBDAISY / UTILITY

More...

#include <color.h>

Public Types

Name
enum PresetColor

Public Functions

Name
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)

Detailed Description

class daisy::Color;

Class for handling simple colors

Public Types Documentation

enum PresetColor

Enumerator Value Description
RED &
GREEN &
BLUE &
WHITE &
PURPLE &
CYAN &
GOLD &
OFF &
LAST &

List of colors that have a preset RGB value

Public Functions Documentation

function Color

inline Color()

function ~Color

inline ~Color()

function Init

void Init(
    PresetColor c
)

Parameters:

Initializes the Color with a given preset.


function Init

void Init(
    float red,
    float green,
    float blue
)

Parameters:

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

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


function Red

inline float Red() const

Returns the 0-1 value for Red


function Green

inline float Green() const

Returns the 0-1 value for Green


function Blue

inline float Blue() const

Returns the 0-1 value for Blue


function Red8

inline uint8_t Red8() const

function Green8

inline uint8_t Green8() const

function Blue8

inline uint8_t Blue8() const

function operator*

inline Color operator*(
    float scale
)

Returns a scaled color by a float

---

Updated on 2024-01-03 at 19:41:01 +0000