JNGL
Color.hpp
Go to the documentation of this file.
1 // Copyright 2012-2020 Jan Niklas Hasse <[email protected]>
2 // For conditions of distribution and use, see copyright notice in LICENSE.txt
4 #pragma once
5 
6 namespace jngl {
24 class Color {
25 public:
29  Color(unsigned char red, unsigned char green, unsigned char blue);
30 
32  unsigned char getRed() const;
34  void setRed(unsigned char);
35 
37  unsigned char getGreen() const;
39  void setGreen(unsigned char);
40 
42  unsigned char getBlue() const;
44  void setBlue(unsigned char);
45 
46 private:
47  unsigned char red;
48  unsigned char green;
49  unsigned char blue;
50 };
51 
54 
57 [[deprecated("use setBackgroundColor(jngl::Color) instead")]]
58 void setBackgroundColor(unsigned char red, unsigned char green, unsigned char blue);
59 
60 } // namespace jngl
61 
63 jngl::Color operator"" _rgb(unsigned long long);
jngl::Color::getRed
unsigned char getRed() const
0...255
jngl
JNGL's main namespace.
Definition: App.hpp:9
jngl::Color::getGreen
unsigned char getGreen() const
0...255
jngl::Color::setGreen
void setGreen(unsigned char)
0...255
jngl::Color::setBlue
void setBlue(unsigned char)
0...255
jngl::Color::getBlue
unsigned char getBlue() const
0...255
jngl::Color
Object representing a RGB color.
Definition: Color.hpp:24
jngl::setBackgroundColor
void setBackgroundColor(jngl::Color)
Sets the screen's background color which is visible when nothing is drawn.
jngl::Color::setRed
void setRed(unsigned char)
0...255
jngl::Color::Color
Color(unsigned char red, unsigned char green, unsigned char blue)