16 using namespace hippodraw;
25 : m_red( red ), m_green( green ), m_blue( blue )
116 ColorMapByName_t :: const_iterator first =
s_color_by_name.find ( name );
117 const Color color = first -> second;
137 ColorMapByName_t::const_iterator first =
s_color_by_name.find ( name );
142 const std::vector < std::string > &
150 const string & name = (it++) -> first;
187 case 0: retColor=
red;
break;
188 case 1: retColor=
green;
break;
189 case 2: retColor=
blue;
break;
190 case 3: retColor=
magenta;
break;
191 default: retColor=
orange;
static Color::Value getColor()
Instead of getting a random color, this static method loop over the 5 common colors: red...
static const std::vector< std::string > & colorNames()
Returns the list of color names.
static std::vector< std::string > s_color_names
The list of available color names.
int m_blue
The blue component of the color.
void setColor(const std::string &)
Sets the color.
Color(int red=0, int green=0, int blue=0)
The following constructor takes red, green, and blue components as arguments.
static void addColor(const char *name, const Color &color)
Adds a named color to the color by name map.
static void initColorByNameMap()
Initializes the mapping of a name to Color object.
static int colorIndex
Color index for composite plotter.
static ColorMapByName_t s_color_by_name
The color by name map.
Value
A few common colors.
A Color class for creating the color object following the standard RGB color space.
int m_green
The green component of the color.
int m_red
The red component of the color.
std::map< std::string, Color > ColorMapByName_t
The type of container mapping string to Color object.
static bool isValid(const std::string &name)
Returns true if name is a valid color.
list< QAction * >::iterator it