5 #ifndef BPP_GRAPHICS_COLORMANAGER_H 6 #define BPP_GRAPHICS_COLORMANAGER_H 9 #include "../Text/TextTools.h" 23 template<
class CodeType>
47 virtual const std::vector<CodeType>&
getCodes()
const = 0;
52 virtual const std::vector<RGBColor>&
getColors()
const = 0;
90 codes_.push_back(8); colors_.push_back(
RGBColor(0, 0, 140));
91 codes_.push_back(9); colors_.push_back(
RGBColor(0, 0, 173));
92 codes_.push_back(10); colors_.push_back(
RGBColor(0, 0, 206));
93 codes_.push_back(11); colors_.push_back(
RGBColor(132, 207, 205));
94 codes_.push_back(12); colors_.push_back(
RGBColor(0, 142, 0));
95 codes_.push_back(13); colors_.push_back(
RGBColor(0, 174, 0));
96 codes_.push_back(14); colors_.push_back(
RGBColor(0, 207, 0));
97 codes_.push_back(15); colors_.push_back(
RGBColor(0, 142, 140));
98 codes_.push_back(16); colors_.push_back(
RGBColor(0, 174, 173));
99 codes_.push_back(17); colors_.push_back(
RGBColor(0, 207, 206));
100 codes_.push_back(18); colors_.push_back(
RGBColor(140, 0, 0));
101 codes_.push_back(19); colors_.push_back(
RGBColor(173, 0, 0));
102 codes_.push_back(20); colors_.push_back(
RGBColor(206, 0, 0));
103 codes_.push_back(21); colors_.push_back(
RGBColor(140, 0, 140));
104 codes_.push_back(22); colors_.push_back(
RGBColor(173, 0, 173));
105 codes_.push_back(23); colors_.push_back(
RGBColor(206, 0, 206));
106 codes_.push_back(24); colors_.push_back(
RGBColor(132, 48, 0));
107 codes_.push_back(25); colors_.push_back(
RGBColor(156, 65, 0));
108 codes_.push_back(26); colors_.push_back(
RGBColor(189, 97, 0));
109 codes_.push_back(27); colors_.push_back(
RGBColor(255, 130, 132));
110 codes_.push_back(28); colors_.push_back(
RGBColor(255, 158, 156));
111 codes_.push_back(29); colors_.push_back(
RGBColor(255, 190, 189));
112 codes_.push_back(30); colors_.push_back(
RGBColor(255, 223, 222));
113 codes_.push_back(31); colors_.push_back(
RGBColor(255, 215, 0));
120 for (
unsigned int i = 0; i < colors_.size(); i++)
122 if (colors_[i] == color)
128 colors_.push_back(color);
129 codes_.push_back(currentCode_);
134 for (
unsigned int i = 0; i < codes_.size(); i++)
136 if (codes_[i] == code)
143 const std::vector<unsigned int>&
getCodes()
const {
return codes_; }
144 const std::vector<RGBColor>&
getColors()
const {
return colors_; }
148 #endif // BPP_GRAPHICS_COLORMANAGER_H virtual const std::vector< RGBColor > & getColors() const =0
unsigned int currentCode_
Describe a color according to its red, green and blue componants.
const std::vector< unsigned int > & getCodes() const
virtual size_t getNumberOfColors() const =0
Associate special colors to a code.
const std::vector< RGBColor > & getColors() const
Color manager for the XFig format.
const RGBColor & getColor(unsigned int &code) const
std::vector< unsigned int > codes_
unsigned int getCode(const RGBColor &color)
virtual const RGBColor & getColor(CodeType &code) const =0
Exception base class. Overload exception constructor (to control the exceptions mechanism). Destructor is already virtual (from std::exception)
virtual CodeType getCode(const RGBColor &color)=0
virtual const std::vector< CodeType > & getCodes() const =0
std::vector< RGBColor > colors_
size_t getNumberOfColors() const
std::string toString(T t)
General template method to convert to a string.
virtual ~XFigColorManager()