src/colors.h

changeset 1114
ffd49a28f49e
parent 1072
9ce9496427f2
child 1174
91696a2e022c
equal deleted inserted replaced
1113:5f3139c802bf 1114:ffd49a28f49e
34 QColor faceColor; 34 QColor faceColor;
35 QColor edgeColor; 35 QColor edgeColor;
36 }; 36 };
37 37
38 ColorData(); 38 ColorData();
39 ~ColorData();
40 void loadFromLdconfig(); 39 void loadFromLdconfig();
41 bool contains(int code) const; 40 bool contains(int code) const;
42 const Entry& get(int code) const; 41 const Entry& get(int code) const;
43 42
44 private: 43 private:
66 QColor edgeColor() const; 65 QColor edgeColor() const;
67 qint32 index() const; 66 qint32 index() const;
68 bool isDirect() const; 67 bool isDirect() const;
69 QString indexString() const; 68 QString indexString() const;
70 69
71 static LDColor nullColor(); 70 static const LDColor nullColor;
71 static void initColors();
72 72
73 LDColor& operator=(qint32 index) { m_index = index; return *this; } 73 LDColor& operator=(qint32 index) { m_index = index; return *this; }
74 LDColor& operator=(const LDColor &other) = default; 74 LDColor& operator=(const LDColor &other) = default;
75 LDColor operator++() { return ++m_index; } 75 LDColor operator++() { return ++m_index; }
76 LDColor operator++(int) { return m_index++; } 76 LDColor operator++(int) { return m_index++; }
82 bool operator<=(LDColor other) const { return index() <= other.index(); } 82 bool operator<=(LDColor other) const { return index() <= other.index(); }
83 bool operator>(LDColor other) const { return index() > other.index(); } 83 bool operator>(LDColor other) const { return index() > other.index(); }
84 bool operator>=(LDColor other) const { return index() >= other.index(); } 84 bool operator>=(LDColor other) const { return index() >= other.index(); }
85 85
86 private: 86 private:
87 static ColorData* colorData;
87 const ColorData::Entry& data() const; 88 const ColorData::Entry& data() const;
88 89
89 qint32 m_index; 90 qint32 m_index;
90 }; 91 };
91 92
108 109
109 private: 110 private:
110 QStringList m_tokens; 111 QStringList m_tokens;
111 }; 112 };
112 113
113 void initColors();
114 int luma(const QColor& col); 114 int luma(const QColor& col);
115 115
116 enum 116 enum
117 { 117 {
118 MainColor = 16, 118 MainColor = 16,

mercurial