2019-11-13 13:37:49 +01:00
|
|
|
#ifndef LIBRARY_COLOR_HPP
|
|
|
|
#define LIBRARY_COLOR_HPP
|
|
|
|
|
|
|
|
namespace vkvm {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* color values represented as rgb values.
|
|
|
|
* @author Johannes Theiner
|
|
|
|
* @since 0.1.0
|
|
|
|
*/
|
|
|
|
class Color {
|
|
|
|
|
|
|
|
private:
|
|
|
|
unsigned char red;
|
|
|
|
unsigned char green;
|
|
|
|
unsigned char blue;
|
|
|
|
|
|
|
|
public:
|
2019-11-26 13:22:53 +01:00
|
|
|
Color() noexcept;
|
|
|
|
|
2019-11-13 13:37:49 +01:00
|
|
|
Color(unsigned char red, unsigned char green, unsigned char blue) noexcept;
|
|
|
|
|
2019-11-26 13:22:53 +01:00
|
|
|
Color(const Color &color) noexcept;
|
|
|
|
|
2019-11-21 12:37:52 +01:00
|
|
|
explicit Color(unsigned int hex) noexcept;
|
|
|
|
|
2019-11-13 13:37:49 +01:00
|
|
|
auto getRed() -> unsigned char;
|
|
|
|
|
|
|
|
auto getGreen() -> unsigned char;
|
|
|
|
|
|
|
|
auto getBlue() -> unsigned char;
|
|
|
|
|
|
|
|
auto setRed(unsigned char value) -> void;
|
|
|
|
|
|
|
|
auto setGreen(unsigned char value) -> void;
|
|
|
|
|
|
|
|
auto setBlue(unsigned char value) -> void;
|
|
|
|
|
2019-11-21 11:35:54 +01:00
|
|
|
bool operator==(const Color &other) const ;
|
|
|
|
|
|
|
|
bool operator!=(const Color &other) const ;
|
|
|
|
|
2019-11-13 13:37:49 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
const static Color black = Color(0, 0, 0);
|
|
|
|
const static Color white = Color(255, 255, 255);
|
2019-11-21 11:35:54 +01:00
|
|
|
const static Color green = Color(0, 255, 0);
|
|
|
|
const static Color red = Color(255, 0, 0);
|
|
|
|
const static Color blue = Color(0, 0, 255);
|
2019-11-13 13:37:49 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|