gdk-graphics  1b6d84e044c2c953fd7c9501e628a67e80f4da0d
color.h
1 // © 2018 Joseph Cameron - All Rights Reserved
2 
3 #ifndef GDK_GFX_COLOR_H
4 #define GDK_GFX_COLOR_H
5 
6 #include <iosfwd>
7 
8 namespace gdk
9 {
11  struct color final
12  {
13  using channel_type = float;
14 
15  channel_type r = 0, g = 0, b = 0, a = 1;
16 
18  bool operator==(const color &aOther) const;
20  bool operator!=(const color &aOther) const;
21 
23  color(const color &) = default;
25  color& operator=(const color &acolor) = default;
26 
28  color(color &&) = default;
30  color& operator=(color &&acolor) = default;
31 
33  color() = default;
34 
37  color(const channel_type aR,
38  const channel_type aG,
39  const channel_type aB,
40  const channel_type aA = 1);
41 
44  //
46  static const color Black;
48  static const color White;
50  static const color Red;
52  static const color Green;
54  static const color DarkGreen;
56  static const color Blue;
59  static const color DeathlyPink;
61  static const color CornflowerBlue;
63  };
64 
65  std::ostream &operator<<(std::ostream &stream, const color &acolor);
66 }
67 
68 #endif
69 
static const color Red
opaque red color
Definition: color.h:50
static const color Blue
opaque blue color
Definition: color.h:56
Definition: camera.h:9
static const color Green
opaque green color
Definition: color.h:52
static const color White
opaque white color
Definition: color.h:48
bool operator!=(const color &aOther) const
equality semantics
static const color CornflowerBlue
an opaque pastel blue color
Definition: color.h:61
static const color DarkGreen
opaque dark green color
Definition: color.h:54
static const color DeathlyPink
Definition: color.h:59
bool operator==(const color &aOther) const
equality semantics
color()=default
constructs a color as opaque black
color & operator=(const color &acolor)=default
copy semantics
Represents a 4 channel color: {Red, Green, Blue, Alpha}.
Definition: color.h:11
static const color Black
opaque black color
Definition: color.h:46