library/src/Color.hpp

52 lines
1.0 KiB
C++
Raw Normal View History

#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:
Color() noexcept;
Color(int red, int green, int blue) noexcept;
2019-11-21 12:37:52 +01:00
explicit Color(unsigned int hex) noexcept;
auto getRed() -> unsigned char;
auto getGreen() -> unsigned char;
auto getBlue() -> unsigned char;
auto setRed(int value) -> void;
auto setGreen(int value) -> void;
auto setBlue(int value) -> void;
2019-11-21 11:35:54 +01:00
bool operator==(const Color &other) const ;
bool operator!=(const Color &other) const ;
};
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);
}
#endif