-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRGB.h
More file actions
48 lines (39 loc) · 935 Bytes
/
RGB.h
File metadata and controls
48 lines (39 loc) · 935 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* RGB.h
*
* Copyright (c) 2024 Yang D.L.
*
* License: GPL-2.0-or-later
*/
#pragma once
#include <Arduino.h>
class RGB {
public:
uint8_t r, g, b;
~RGB() = default;
RGB();
RGB(const RGB& rgb);
RGB(uint32_t rgb);
RGB(const char *rgb);
RGB(const String& rgb);
RGB(uint8_t r, uint8_t g, uint8_t b);
RGB(std::initializer_list<uint8_t> list);
RGB& operator=(const RGB& rgb);
RGB& operator=(uint32_t rgb);
RGB& operator=(const char *rgb);
RGB& operator=(const String& rgb);
RGB& operator=(std::initializer_list<uint8_t> list);
RGB operator&(const RGB& rgb) const;
RGB operator|(const RGB& rgb) const;
RGB operator~() const;
RGB operator+(const RGB& rgh) const;
RGB operator-(const RGB& rgh) const;
RGB operator*(double k) const;
static const RGB White;
static const RGB Red;
static const RGB Green;
static const RGB Blue;
static const RGB Yellow;
static const RGB Cyan;
static const RGB Magenta;
};