1 |
|
|
#include "RGB.hpp" |
2 |
|
|
|
3 |
|
|
namespace blink1_lib { |
4 |
|
115 |
RGB::RGB(const std::uint8_t _r, const std::uint8_t _g, const std::uint8_t _b) noexcept : r(_r), g(_g), b(_b) {} |
5 |
|
|
|
6 |
|
14 |
bool RGB::operator==(const RGB& other) const noexcept { |
7 |
✓✓✓✓ ✓✓ |
14 |
return r == other.r && g == other.g && b == other.b; |
8 |
|
|
} |
9 |
|
|
|
10 |
|
3 |
bool RGB::operator!=(const RGB& other) const noexcept { |
11 |
|
3 |
return !(*this == other); |
12 |
|
|
} |
13 |
|
|
|
14 |
|
2 |
std::ostream& operator<<(std::ostream& os, const RGB& rgb) { |
15 |
|
2 |
os << "RGB{r=" << static_cast<unsigned>(rgb.r) |
16 |
|
2 |
<< ", g=" << static_cast<unsigned>(rgb.g) |
17 |
|
2 |
<< ", b=" << static_cast<unsigned>(rgb.b) << "}"; |
18 |
|
2 |
return os; |
19 |
|
|
} |
20 |
|
|
} |