hyperion.ng
ColorArgb.h
1 #pragma once
2 
3 // STL includes
4 #include <cstdint>
5 #include <ostream>
6 
7 struct ColorArgb;
8 
9 struct ColorArgb
10 {
11 
13  uint8_t alpha;
14 
16  uint8_t red;
18  uint8_t green;
20  uint8_t blue;
21 
23  static ColorArgb BLACK;
25  static ColorArgb RED;
27  static ColorArgb GREEN;
29  static ColorArgb BLUE;
31  static ColorArgb YELLOW;
33  static ColorArgb WHITE;
34 };
35 
36 
38 static_assert(sizeof(ColorArgb) == 4, "Incorrect size of ColorARGB");
39 
47 inline std::ostream& operator<<(std::ostream& os, const ColorArgb& color)
48 {
49  os << "{" << unsigned(color.alpha) << "," << unsigned(color.red) << "," << unsigned(color.green) << "," << unsigned(color.blue) << "}";
50  return os;
51 }
52 
static ColorArgb RED
&#39;Red&#39; RgbColor (255, 255, 0, 0)
Definition: ColorArgb.h:25
static ColorArgb BLUE
&#39;Blue&#39; RgbColor (255, 0, 0, 255)
Definition: ColorArgb.h:29
static ColorArgb YELLOW
&#39;Yellow&#39; RgbColor (255, 255, 255, 0)
Definition: ColorArgb.h:31
uint8_t alpha
The alpha mask channel.
Definition: ColorArgb.h:13
static ColorArgb GREEN
&#39;Green&#39; RgbColor (255, 0, 255, 0)
Definition: ColorArgb.h:27
uint8_t green
The green color channel.
Definition: ColorArgb.h:18
Definition: ColorArgb.h:9
uint8_t red
The red color channel.
Definition: ColorArgb.h:16
static ColorArgb BLACK
&#39;Black&#39; RgbColor (255, 0, 0, 0)
Definition: ColorArgb.h:23
static ColorArgb WHITE
&#39;White&#39; RgbColor (255, 255, 255, 255)
Definition: ColorArgb.h:33
uint8_t blue
The blue color channel.
Definition: ColorArgb.h:20