lemon/color.h
changeset 2173 b4de9aed7709
parent 2159 dd3181a462d0
child 2174 f9e43b5cc617
equal deleted inserted replaced
2:4c119fb3cd1b 3:bfe930f81ffe
    79 ///number. The integer range is cyclically mapped to the provided set of colors.
    79 ///number. The integer range is cyclically mapped to the provided set of colors.
    80 ///
    80 ///
    81 ///This is a true \ref concept::ReferenceMap "reference map", so you can also
    81 ///This is a true \ref concept::ReferenceMap "reference map", so you can also
    82 ///change the actual colors.
    82 ///change the actual colors.
    83 
    83 
    84 class ColorSet : public MapBase<int,Color>
    84 class Palette : public MapBase<int,Color>
    85 {
    85 {
    86   std::vector<Color> colors;
    86   std::vector<Color> colors;
    87 public:
    87 public:
    88   ///Constructor
    88   ///Constructor
    89 
    89 
    94   ///\param num the number of the allocated colors. If it is \c 0
    94   ///\param num the number of the allocated colors. If it is \c 0
    95   ///the default color configuration is set up (26 color plus the while).
    95   ///the default color configuration is set up (26 color plus the while).
    96   ///If \c num is less then 26/27 then the default color list is cut. Otherwise
    96   ///If \c num is less then 26/27 then the default color list is cut. Otherwise
    97   ///the color list is filled repeatedly with the default color list.
    97   ///the color list is filled repeatedly with the default color list.
    98   ///(The colors can be changed later on.)
    98   ///(The colors can be changed later on.)
    99   ColorSet(bool have_white=false,int num=0)
    99   Palette(bool have_white=false,int num=0)
   100   {
   100   {
   101     do {
   101     do {
   102       if(have_white) colors.push_back(Color(1,1,1));
   102       if(have_white) colors.push_back(Color(1,1,1));
   103 
   103 
   104       colors.push_back(Color(0,0,0));
   104       colors.push_back(Color(0,0,0));