Struct Color

Struct Documentation

struct Color

Structure to describe an RGB color.

Public Functions

inline Color()

Creates a color object with zero for the red, green, blue, and alpha channels.

inline Color(uint8_t r, uint8_t g, uint8_t b, uint8_t a)

Creates a color from the given red, green, blue, and alpha channel values.

Each parameter should be between 0 and 255.

inline Color(uint8_t r, uint8_t g, uint8_t b)

Creates a color from the given red, green, and blue values.

This sets the alpha channel to “255”. Each parameter should be between 0 and 255.

inline uint8_t getRed() const

Returns the red channel; value is between 0 and 255.

inline uint8_t getGreen() const

Returns the green channel; value is between 0 and 255.

inline uint8_t getBlue() const

Returns the blue channel; value is between 0 and 255.

inline uint8_t getAlpha() const

Returns the alpha channel; value is between 0 and 255. ‘0’ indicates the module has control over this color, and any other value indicates that there is a command overriding this channel. For feedback/info values, this value should currently be ignored.

inline void setRed(uint8_t r)
inline void setGreen(uint8_t g)
inline void setBlue(uint8_t b)
inline void setAlpha(uint8_t a)
inline uint32_t toInt() const