GameKit  0.0.1a
C++ gamedev tools
Color.cpp
Go to the documentation of this file.
1 /*
2  * =====================================================================================
3  *
4  * Filename: Color.cpp
5  *
6  * Description:
7  *
8  * Created: 27/09/2014 22:35:45
9  *
10  * Author: Quentin Bazin, <quent42340@gmail.com>
11  *
12  * =====================================================================================
13  */
14 #include "gk/graphics/Color.hpp"
15 
16 namespace gk {
17 
18 const Color Color::Black(0, 0, 0);
19 const Color Color::White(255, 255, 255);
20 const Color Color::Red(255, 0, 0);
21 const Color Color::Green(0, 255, 0);
22 const Color Color::Blue(0, 0, 255);
23 const Color Color::Yellow(255, 255, 0);
24 const Color Color::Magenta(255, 0, 255);
25 const Color Color::Cyan(0, 255, 255);
26 const Color Color::Transparent(0, 0, 0, 0);
27 
28 Color::Color(u8 _r, u8 _g, u8 _b, u8 _a) {
29  r = _r / 255.0f;
30  g = _g / 255.0f;
31  b = _b / 255.0f;
32  a = _a / 255.0f;
33 }
34 
35 } // namespace gk
36 
static const Color Transparent
Transparent (black) predefined color.
Definition: Color.hpp:124
static const Color Green
Green predefined color.
Definition: Color.hpp:119
Color()=default
Default constructor.
static const Color Yellow
Yellow predefined color.
Definition: Color.hpp:121
static const Color Cyan
Cyan predefined color.
Definition: Color.hpp:123
static const Color Magenta
Magenta predefined color.
Definition: Color.hpp:122
unsigned char u8
Definition: IntTypes.hpp:21
float g
Green component.
Definition: Color.hpp:112
float a
Alpha (opacity) component.
Definition: Color.hpp:114
static const Color White
White predefined color.
Definition: Color.hpp:117
float b
Blue component.
Definition: Color.hpp:113
float r
Red component.
Definition: Color.hpp:111
static const Color Blue
Blue predefined color.
Definition: Color.hpp:120
static const Color Black
Black predefined color.
Definition: Color.hpp:116
static const Color Red
Red predefined color.
Definition: Color.hpp:118