41 #ifndef BPP_GRAPHICS_COLORSET_H
42 #define BPP_GRAPHICS_COLORSET_H
45 #include "../Utils/MapTools.h"
111 std::map<std::string, RGBColor>::const_iterator it =
colors_.find(name);
112 if (it !=
colors_.end())
return it->second;
113 else throw Exception(
"AbstractColorSet::getColor(name): no color with name " + name);
119 std::map<std::string, RGBColor>::const_iterator it =
colors_.begin();
120 for (
unsigned int i = 0; i < index; i++) { it++;}
Partial implementation of the ColorSet interface.
const RGBColor & getColor(const std::string &name) const
Get the color object corresponding to a given name.
std::map< std::string, RGBColor > colors_
const RGBColor & getColor(unsigned int index) const
Get the ith color object in the set.
size_t getNumberOfColors() const
virtual ~AbstractColorSet()
std::vector< std::string > getColorNames() const
Specify a set of color definitions.
virtual const RGBColor & getColor(const std::string &name) const =0
Get the color object corresponding to a given name.
virtual const RGBColor & getColor(unsigned int index) const =0
Get the ith color object in the set.
virtual size_t getNumberOfColors() const =0
virtual std::vector< std::string > getColorNames() const =0
Exception base class. Overload exception constructor (to control the exceptions mechanism)....
Index out of bounds exception class.
Describe a color according to its red, green and blue componants.