diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-10-29 21:49:54 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2018-10-29 21:52:12 +0100 |
commit | b1296f2c97c6fdc1c6a9922dc09c951b5cafdc12 (patch) | |
tree | 0986a2e3ab45f73c1f7219deef044b3d4ca94e89 /include/dchat/Color.hpp |
Initial commit
Diffstat (limited to 'include/dchat/Color.hpp')
-rw-r--r-- | include/dchat/Color.hpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/dchat/Color.hpp b/include/dchat/Color.hpp new file mode 100644 index 0000000..2a5d121 --- /dev/null +++ b/include/dchat/Color.hpp @@ -0,0 +1,24 @@ +#pragma once + +namespace dchat +{ + class Color + { + public: + Color() : Color(255, 255, 255, 255) {} + Color(unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha = 255) + { + data[0] = red; + data[1] = green; + data[2] = blue; + data[3] = alpha; + } + + unsigned char red() const { return data[0]; } + unsigned char green() const { return data[1]; } + unsigned char blue() const { return data[2]; } + unsigned char alpha() const { return data[3]; } + + unsigned char data[4]; + }; +}
\ No newline at end of file |