3 |
3 |
4 struct Color |
4 struct Color |
5 { |
5 { |
6 qint32 index; |
6 qint32 index; |
7 }; |
7 }; |
|
8 |
|
9 inline bool operator==(const Color& one, const Color& other) |
|
10 { |
|
11 return one.index == other.index; |
|
12 } |
|
13 |
|
14 inline bool operator!=(const Color& one, const Color& other) |
|
15 { |
|
16 return one.index != other.index; |
|
17 } |
|
18 |
|
19 inline bool operator<(const Color& one, const Color& other) |
|
20 { |
|
21 return one.index < other.index; |
|
22 } |
|
23 |
|
24 inline bool operator<=(const Color& one, const Color& other) |
|
25 { |
|
26 return one.index <= other.index; |
|
27 } |
|
28 |
|
29 inline bool operator>(const Color& one, const Color& other) |
|
30 { |
|
31 return one.index > other.index; |
|
32 } |
|
33 |
|
34 inline bool operator>=(const Color& one, const Color& other) |
|
35 { |
|
36 return one.index >= other.index; |
|
37 } |
8 |
38 |
9 namespace colors |
39 namespace colors |
10 { |
40 { |
11 static constexpr Color black {0}; |
41 static constexpr Color black {0}; |
12 static constexpr Color blue {1}; |
42 static constexpr Color blue {1}; |