25 void Set(uint8_t r, uint8_t g, uint8_t b) {
r_ = r;
g_ = g;
b_ = b; }
29 void Mul(uint8_t val) {
34 uint8_t
Get(
int rgb_index)
const;
35 void Set(
int rgb_index, uint8_t val);
36 void Fill(uint8_t val) {
Set(val, val, val); }
39 return max_r_g >
b_ ? max_r_g :
b_;
42 template <
typename Pr
intStream>
43 inline void Print(PrintStream* stream)
const {
44 stream->print(
"RGB:\t");
45 stream->print(
r_); stream->print(
",\t");
46 stream->print(
g_); stream->print(
",\t");
53 uint8_t*
At(
int rgb_index);
54 const uint8_t*
At(
int rgb_index)
const;
84 void Set(
float h,
float s,
float v) {
90 template <
typename Pr
intStream>
91 inline void Print(PrintStream* stream) {
92 stream->print(
"HSV:\t");
93 stream->print(
h_); stream->print(
",\t");
94 stream->print(
s_); stream->print(
",\t");
95 stream->print(
v_); stream->print(
"\n");
99 return h_ == other.
h_ &&
s_ == other.
s_ &&
v_ == other.
v_;
102 return !(*
this == other);
void Add(const Color3i &color)
Color3i(uint8_t r, uint8_t g, uint8_t b)
Color3i(const Color3i &other)
void Mul(const Color3i &other_color)
void Interpolate(const Color3i &other_color, float t)
void Sub(const Color3i &color)
void Set(uint8_t r, uint8_t g, uint8_t b)
Color3i & operator=(const Color3i &other)
void Print(PrintStream *stream) const
uint8_t * At(int rgb_index)
uint8_t Get(int rgb_index) const
void Set(const Color3i &c)
bool operator==(const ColorHSV &other) const
ColorHSV(const Color3i &color)
ColorHSV & operator=(const Color3i &color)
void Print(PrintStream *stream)
ColorHSV & operator=(const ColorHSV &other)
void Set(const ColorHSV &other)
ColorHSV(const ColorHSV &other)
bool operator!=(const ColorHSV &other) const
void FromRGB(const Color3i &rgb)
ColorHSV(float h, float s, float v)
void Set(float h, float s, float v)