11 #include <boost/algorithm/clamp.hpp>
17 : redComponent((unsigned char)0), greenComponent((unsigned char)0),
18 blueComponent((unsigned char)0), alphaComponent((unsigned char)255)
24 const unsigned char _greenValue,
25 const unsigned char _blueValue,
26 const unsigned char _alphaValue)
27 : redComponent(_redValue), greenComponent(_greenValue),
28 blueComponent(_blueValue), alphaComponent(_alphaValue)
34 const unsigned char _alphaValue)
35 : redComponent(_grayValue), greenComponent(_grayValue),
36 blueComponent(_grayValue), alphaComponent(_alphaValue)
42 : redComponent(_color.redComponent), greenComponent(_color.greenComponent),
43 blueComponent(_color.blueComponent), alphaComponent(_color.alphaComponent)
52 const unsigned char _greenValue,
53 const unsigned char _blueValue)
55 redComponent = _redValue;
56 greenComponent = _greenValue;
57 blueComponent = _blueValue;
66 const unsigned char _greenValue,
67 const unsigned char _blueValue,
68 const unsigned char _alphaValue)
70 redComponent = _redValue;
71 greenComponent = _greenValue;
72 blueComponent = _blueValue;
73 alphaComponent = _alphaValue;
82 redComponent = _redValue;
89 greenComponent = _greenValue;
96 blueComponent = _blueValue;
103 alphaComponent = _alphaValue;
117 return greenComponent;
124 return blueComponent;
131 return alphaComponent;
203 c.
redComponent = (
unsigned char)boost::algorithm::clamp(
204 (
unsigned int)redComponent + (
unsigned int)_color.
redComponent, 0, 255);
206 (
unsigned int)greenComponent + (
unsigned int)_color.
greenComponent,
210 (
unsigned int)blueComponent + (
unsigned int)_color.
blueComponent, 0, 255);
212 (
unsigned int)alphaComponent, (
unsigned int)_color.
alphaComponent);
221 redComponent = (
unsigned char)boost::algorithm::clamp(
222 (
unsigned int)redComponent + (
unsigned int)_color.
redComponent, 0, 255);
223 greenComponent = (
unsigned char)boost::algorithm::clamp(
224 (
unsigned int)greenComponent + (
unsigned int)_color.
greenComponent,
227 blueComponent = (
unsigned char)boost::algorithm::clamp(
228 (
unsigned int)blueComponent + (
unsigned int)_color.
blueComponent, 0, 255);
229 alphaComponent = (
unsigned char)std::max((
unsigned int)alphaComponent,
241 c.
redComponent = (
unsigned char)boost::algorithm::clamp(
242 (
unsigned int)redComponent - (
unsigned int)_color.
redComponent, 0, 255);
244 (
unsigned int)greenComponent - (
unsigned int)_color.
greenComponent,
248 (
unsigned int)blueComponent - (
unsigned int)_color.
blueComponent, 0, 255);
250 (
unsigned int)alphaComponent, (
unsigned int)_color.
alphaComponent);
259 redComponent = (
unsigned char)boost::algorithm::clamp(
260 (
unsigned int)redComponent - (
unsigned int)_color.
redComponent, 0, 255);
261 greenComponent = (
unsigned char)boost::algorithm::clamp(
262 (
unsigned int)greenComponent - (
unsigned int)_color.
greenComponent,
265 blueComponent = (
unsigned char)boost::algorithm::clamp(
266 (
unsigned int)blueComponent - (
unsigned int)_color.
blueComponent, 0, 255);
267 alphaComponent = (
unsigned char)std::min((
unsigned int)alphaComponent,
278 c.
redComponent = (
unsigned char)boost::algorithm::clamp(
279 (
unsigned int)redComponent * _scale, 0, 255);
281 (
unsigned int)greenComponent * _scale, 0, 255);
283 (
unsigned int)blueComponent * _scale, 0, 255);
293 redComponent = (
unsigned char)boost::algorithm::clamp(
294 (
unsigned int)redComponent * _scale, 0, 255);
295 greenComponent = (
unsigned char)boost::algorithm::clamp(
296 (
unsigned int)greenComponent * _scale, 0, 255);
297 blueComponent = (
unsigned char)boost::algorithm::clamp(
298 (
unsigned int)blueComponent * _scale, 0, 255);
309 _out <<
"[Color] RGBA(" << (
unsigned int)redComponent <<
","
310 << (
unsigned int)greenComponent <<
"," << (
unsigned int)blueComponent
311 <<
"," << (
unsigned int)alphaComponent <<
")";
319 return Color(0, 0, 0, 0);
325 return Color(0, 0, 0);
331 return Color(255, 255, 255);
337 return Color(244, 67, 54);
343 return Color(233, 30, 99);
349 return Color(156, 39, 176);
355 return Color(103, 58, 183);
361 return Color(63, 81, 181);
367 return Color(33, 150, 243);
373 return Color(3, 169, 244);
379 return Color(0, 188, 212);
385 return Color(0, 150, 136);
391 return Color(76, 175, 80);
397 return Color(139, 195, 74);
403 return Color(205, 220, 57);
409 return Color(255, 235, 59);
415 return Color(255, 193, 7);
421 return Color(243, 156, 18);
427 return Color(255, 87, 34);
433 return Color(121, 85, 72);
439 return Color(158, 158, 158);
445 return Color(96, 125, 139);
454 return Color(26, 188, 156);
460 return Color(22, 160, 133);
466 return Color(46, 204, 113);
472 return Color(39, 174, 96);
478 return Color(41, 128, 185);
484 return Color(41, 128, 185);
490 return Color(155, 89, 182);
496 return Color(142, 68, 173);
502 return Color(52, 73, 94);
508 return Color(44, 62, 80);
514 return Color(241, 196, 15);
520 return Color(230, 126, 34);
526 return Color(211, 84, 0);
532 return Color(231, 76, 60);
538 return Color(192, 57, 43);
544 return Color(236, 240, 241);
550 return Color(189, 195, 199);
556 return Color(149, 165, 166);
562 return Color(127, 140, 141);