109 std::vector<Color> colors; |
109 std::vector<Color> colors; |
110 public: |
110 public: |
111 ///Constructor |
111 ///Constructor |
112 |
112 |
113 ///Constructor |
113 ///Constructor |
|
114 ///\param have_white indicates whether white is amongst the |
|
115 ///provided initial colors (\c true) or not (\c false). If it is true, |
|
116 ///white will be assigned to \c 0. |
114 ///\param num the number of the allocated colors. If it is \c -1, |
117 ///\param num the number of the allocated colors. If it is \c -1, |
115 ///the default color configuration is set up (26 color plus the |
118 ///the default color configuration is set up (26 color plus optionaly the |
116 ///white). If \c num is less then 26/27 then the default color |
119 ///white). If \c num is less then 26/27 then the default color |
117 ///list is cut. Otherwise the color list is filled repeatedly with |
120 ///list is cut. Otherwise the color list is filled repeatedly with |
118 ///the default color list. (The colors can be changed later on.) |
121 ///the default color list. (The colors can be changed later on.) |
119 ///\param have_white indicates whether white is amongst the |
|
120 ///provided color (\c true) or not (\c false). If it is true, |
|
121 ///white will be assigned to \c 0. |
|
122 Palette(bool have_white=false,int num=-1) |
122 Palette(bool have_white=false,int num=-1) |
123 { |
123 { |
124 if (num==0) return; |
124 if (num==0) return; |
125 do { |
125 do { |
126 if(have_white) colors.push_back(Color(1,1,1)); |
126 if(have_white) colors.push_back(Color(1,1,1)); |
183 void resize(int s) { colors.resize(s);} |
183 void resize(int s) { colors.resize(s);} |
184 ///Returns the number of the existing colors. |
184 ///Returns the number of the existing colors. |
185 int size() const { return int(colors.size());} |
185 int size() const { return int(colors.size());} |
186 }; |
186 }; |
187 |
187 |
188 ///Returns a visible distinct \ref Color |
188 ///Returns a visibly distinct \ref Color |
189 |
189 |
190 ///Returns a \ref Color which is as different from the given parameter |
190 ///Returns a \ref Color which is as different from the given parameter |
191 ///as it is possible. |
191 ///as it is possible. |
192 inline Color distantColor(const Color &c) |
192 inline Color distantColor(const Color &c) |
193 { |
193 { |