41 private: |
47 private: |
42 void loadColorFromString(const QString& string); |
48 void loadColorFromString(const QString& string); |
43 QMap<qint32, ColorDefinition> definitions; |
49 QMap<qint32, ColorDefinition> definitions; |
44 }; |
50 }; |
45 |
51 |
46 inline bool operator==(const Color& one, const Color& other) |
52 inline bool operator==(const ldraw::Color& one, const ldraw::Color& other) |
47 { |
53 { |
48 return one.index == other.index; |
54 return one.index == other.index; |
49 } |
55 } |
50 |
56 |
51 inline bool operator!=(const Color& one, const Color& other) |
57 inline bool operator!=(const ldraw::Color& one, const ldraw::Color& other) |
52 { |
58 { |
53 return one.index != other.index; |
59 return one.index != other.index; |
54 } |
60 } |
55 |
61 |
56 inline bool operator<(const Color& one, const Color& other) |
62 inline bool operator<(const ldraw::Color& one, const ldraw::Color& other) |
57 { |
63 { |
58 return one.index < other.index; |
64 return one.index < other.index; |
59 } |
65 } |
60 |
66 |
61 inline bool operator<=(const Color& one, const Color& other) |
67 inline bool operator<=(const ldraw::Color& one, const ldraw::Color& other) |
62 { |
68 { |
63 return one.index <= other.index; |
69 return one.index <= other.index; |
64 } |
70 } |
65 |
71 |
66 inline bool operator>(const Color& one, const Color& other) |
72 inline bool operator>(const ldraw::Color& one, const ldraw::Color& other) |
67 { |
73 { |
68 return one.index > other.index; |
74 return one.index > other.index; |
69 } |
75 } |
70 |
76 |
71 inline bool operator>=(const Color& one, const Color& other) |
77 inline bool operator>=(const ldraw::Color& one, const ldraw::Color& other) |
72 { |
78 { |
73 return one.index >= other.index; |
79 return one.index >= other.index; |
74 } |
80 } |
75 |
81 |
76 namespace colors |
82 namespace ldraw |
77 { |
83 { |
78 static constexpr Color black {0}; |
84 static constexpr Color black {0}; |
79 static constexpr Color blue {1}; |
85 static constexpr Color blue {1}; |
80 static constexpr Color green {2}; |
86 static constexpr Color green {2}; |
81 static constexpr Color red {4}; |
87 static constexpr Color red {4}; |
82 static constexpr Color yellow {14}; |
88 static constexpr Color yellow {14}; |
83 static constexpr Color white {15}; |
89 static constexpr Color white {15}; |
84 static constexpr Color main {16}; |
90 static constexpr Color mainColor {16}; |
85 static constexpr Color edge {24}; |
91 static constexpr Color edgeColor {24}; |
86 } |
92 } |