CColor.h
Go to the documentation of this file.
1 //==============================================================================
2 /*
3  Software License Agreement (BSD License)
4  Copyright (c) 2003-2016, CHAI3D.
5  (www.chai3d.org)
6 
7  All rights reserved.
8 
9  Redistribution and use in source and binary forms, with or without
10  modification, are permitted provided that the following conditions
11  are met:
12 
13  * Redistributions of source code must retain the above copyright
14  notice, this list of conditions and the following disclaimer.
15 
16  * Redistributions in binary form must reproduce the above
17  copyright notice, this list of conditions and the following
18  disclaimer in the documentation and/or other materials provided
19  with the distribution.
20 
21  * Neither the name of CHAI3D nor the names of its contributors may
22  be used to endorse or promote products derived from this software
23  without specific prior written permission.
24 
25  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
28  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
29  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
30  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
31  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
32  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
33  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
35  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36  POSSIBILITY OF SUCH DAMAGE.
37 
38  \author <http://www.chai3d.org>
39  \author Francois Conti
40  \version 3.2.0 $Rev: 2148 $
41 */
42 //==============================================================================
43 
44 //------------------------------------------------------------------------------
45 #ifndef CColorH
46 #define CColorH
47 //------------------------------------------------------------------------------
48 #include "math/CMaths.h"
49 //------------------------------------------------------------------------------
50 #ifdef C_USE_OPENGL
52 #endif
53 //------------------------------------------------------------------------------
54 
55 //------------------------------------------------------------------------------
56 namespace chai3d {
57 //------------------------------------------------------------------------------
58 
59 //------------------------------------------------------------------------------
60 struct cColorb;
61 struct cColorf;
62 //------------------------------------------------------------------------------
63 
64 //==============================================================================
71 //==============================================================================
72 
73 
74 //------------------------------------------------------------------------------
78 //------------------------------------------------------------------------------
79 
81 
82 //==============================================================================
92 //==============================================================================
93 inline GLubyte cColorFtoB(GLfloat a_value)
94 {
95  return( (GLubyte)(255.0f * cClamp(a_value, 0.0f, 1.0f)) );
96 }
97 
98 
99 //==============================================================================
109 //==============================================================================
110 inline GLfloat cColorBtoF(GLubyte a_value)
111 {
112  return((1.0f / 255.0f) * (GLfloat)a_value);
113 }
114 
116 
117 //==============================================================================
137 //==============================================================================
138 struct cColorf
139 {
140  //--------------------------------------------------------------------------
141  // CONSTRUCTOR & DESTRUCTOR:
142  //--------------------------------------------------------------------------
143 
144 public:
145 
146  //--------------------------------------------------------------------------
151  //--------------------------------------------------------------------------
153  {
154  m_color[0] = 1.0f;
155  m_color[1] = 1.0f;
156  m_color[2] = 1.0f;
157  m_color[3] = 1.0f;
158 
159  m_flag_color = false;
160  }
161 
162 
163  //--------------------------------------------------------------------------
174  //--------------------------------------------------------------------------
175  cColorf(const GLfloat a_red,
176  const GLfloat a_green,
177  const GLfloat a_blue,
178  const GLfloat a_alpha = 1.0f)
179  {
180  m_color[0] = cClamp( a_red, 0.0f, 1.0f);
181  m_color[1] = cClamp( a_green, 0.0f, 1.0f);
182  m_color[2] = cClamp( a_blue, 0.0f, 1.0f);
183  m_color[3] = cClamp( a_alpha, 0.0f, 1.0f);
184 
185  m_flag_color = true;
186  };
187 
188 
189  //--------------------------------------------------------------------------
193  //--------------------------------------------------------------------------
194  ~cColorf() {};
195 
196 
197  //--------------------------------------------------------------------------
198  // PUBLIC METHODS:
199  //--------------------------------------------------------------------------
200 
201 public:
202 
203  //--------------------------------------------------------------------------
211  //--------------------------------------------------------------------------
212  inline void setModificationFlags(const bool a_value) { m_flag_color = a_value; }
213 
214 
215  //--------------------------------------------------------------------------
222  //--------------------------------------------------------------------------
223  inline void copyTo(cColorf& a_color)
224  {
225  if (m_flag_color)
226  {
227  a_color.set(m_color[0], m_color[1], m_color[2], m_color[3]);
228  }
229  }
230 
231 
232  //--------------------------------------------------------------------------
243  //--------------------------------------------------------------------------
244  inline void set(const GLfloat a_red,
245  const GLfloat a_green,
246  const GLfloat a_blue,
247  const GLfloat a_alpha)
248  {
249  m_color[0] = cClamp( a_red, 0.0f, 1.0f);
250  m_color[1] = cClamp( a_green, 0.0f, 1.0f);
251  m_color[2] = cClamp( a_blue, 0.0f, 1.0f);
252  m_color[3] = cClamp( a_alpha, 0.0f, 1.0f);
253  m_flag_color = true;
254  };
255 
256 
257  //--------------------------------------------------------------------------
267  //--------------------------------------------------------------------------
268  inline void set(const GLfloat a_red,
269  const GLfloat a_green,
270  const GLfloat a_blue)
271  {
272  m_color[0] = cClamp( a_red, 0.0f, 1.0f);
273  m_color[1] = cClamp( a_green, 0.0f, 1.0f);
274  m_color[2] = cClamp( a_blue, 0.0f, 1.0f);
275  m_flag_color = true;
276  };
277 
278 
279  //--------------------------------------------------------------------------
290  //--------------------------------------------------------------------------
291  inline void setb(const GLubyte a_red,
292  const GLubyte a_green,
293  const GLubyte a_blue,
294  const GLubyte a_alpha)
295  {
296  m_color[0] = cColorBtoF(a_red);
297  m_color[1] = cColorBtoF(a_green);
298  m_color[2] = cColorBtoF(a_blue);
299  m_color[3] = cColorBtoF(a_alpha);
300  m_flag_color = true;
301  };
302 
303 
304  //--------------------------------------------------------------------------
314  //--------------------------------------------------------------------------
315  inline void setb(const GLubyte a_red,
316  const GLubyte a_green,
317  const GLubyte a_blue)
318  {
319  m_color[0] = cColorBtoF(a_red);
320  m_color[1] = cColorBtoF(a_green);
321  m_color[2] = cColorBtoF(a_blue);
322  m_flag_color = true;
323  };
324 
325 
326  //--------------------------------------------------------------------------
334  //--------------------------------------------------------------------------
335  inline void mul(const GLfloat a_scale)
336  {
337  m_color[0] = cClamp( a_scale * m_color[0], 0.0f, 1.0f);
338  m_color[1] = cClamp( a_scale * m_color[1], 0.0f, 1.0f);
339  m_color[2] = cClamp( a_scale * m_color[2], 0.0f, 1.0f);
340  m_flag_color = true;
341  };
342 
343 
344  //--------------------------------------------------------------------------
352  //--------------------------------------------------------------------------
353  inline void setMem3(const GLfloat* a_colorRGB)
354  {
355  m_color[0] = a_colorRGB[0];
356  m_color[1] = a_colorRGB[1];
357  m_color[2] = a_colorRGB[2];
358  m_color[3] = 1.0;
359  m_flag_color = true;
360  }
361 
362 
363  //--------------------------------------------------------------------------
371  //--------------------------------------------------------------------------
372  inline void setMem4(const GLfloat* a_colorRGBA)
373  {
374  m_color[0] = a_colorRGBA[0];
375  m_color[1] = a_colorRGBA[1];
376  m_color[2] = a_colorRGBA[2];
377  m_color[3] = a_colorRGBA[3];
378  m_flag_color = true;
379  }
380 
381 
382  //--------------------------------------------------------------------------
389  //--------------------------------------------------------------------------
390  inline void setR(const GLfloat a_red)
391  {
392  m_color[0] = cClamp( a_red, 0.0f, 1.0f);
393  m_flag_color = true;
394  }
395 
396 
397  //--------------------------------------------------------------------------
404  //--------------------------------------------------------------------------
405  inline GLfloat getR() const
406  {
407  return(m_color[0]);
408  }
409 
410 
411  //--------------------------------------------------------------------------
418  //--------------------------------------------------------------------------
419  inline void setG(const GLfloat a_green)
420  {
421  m_color[1] = cClamp( a_green, 0.0f, 1.0f);
422  m_flag_color = true;
423  }
424 
425 
426  //--------------------------------------------------------------------------
433  //--------------------------------------------------------------------------
434  inline GLfloat getG() const
435  {
436  return(m_color[1]);
437  }
438 
439 
440  //--------------------------------------------------------------------------
447  //--------------------------------------------------------------------------
448  inline void setB(const GLfloat a_blue)
449  {
450  m_color[2] = cClamp( a_blue, 0.0f, 1.0f);
451  m_flag_color = true;
452  }
453 
454 
455  //--------------------------------------------------------------------------
462  //--------------------------------------------------------------------------
463  inline GLfloat getB() const
464  {
465  return(m_color[2]);
466  }
467 
468 
469  //--------------------------------------------------------------------------
476  //--------------------------------------------------------------------------
477  inline void setA(const GLfloat a_alpha)
478  {
479  m_color[3] = cClamp( a_alpha, 0.0f, 1.0f);
480  m_flag_color = true;
481  }
482 
483 
484  //--------------------------------------------------------------------------
491  //--------------------------------------------------------------------------
492  inline GLfloat getA() const
493  {
494  return(m_color[3]);
495  }
496 
497 
498  //--------------------------------------------------------------------------
505  //--------------------------------------------------------------------------
506  inline void setLuminance(const GLfloat a_luminance)
507  {
508  set(a_luminance, a_luminance, a_luminance);
509  }
510 
511 
512  //--------------------------------------------------------------------------
519  //--------------------------------------------------------------------------
520  inline GLfloat getLuminance() const
521  {
522  return (0.33333f * (m_color[0] + m_color[1] + m_color[2]));
523  }
524 
525 
526  //--------------------------------------------------------------------------
531  //--------------------------------------------------------------------------
532  inline void render() const
533  {
534  #ifdef C_USE_OPENGL
535  glColor4fv(&m_color[0]);
536  #endif
537  };
538 
539 
540  //--------------------------------------------------------------------------
547  //--------------------------------------------------------------------------
548  inline const GLfloat* getData() const
549  {
550  #ifdef C_USE_OPENGL
551  return (&m_color[0]);
552  #endif
553  }
554 
555 
556  //--------------------------------------------------------------------------
563  //--------------------------------------------------------------------------
564  cColorb getColorb() const;
565 
566 
567  //--------------------------------------------------------------------------
574  //--------------------------------------------------------------------------
575  inline GLfloat operator[](const unsigned int n) const
576  {
577  if (n<4)
578  return (m_color[n]);
579  else
580  return (0.0f);
581  }
582 
583 
584  //--------------------------------------------------------------------------
591  //--------------------------------------------------------------------------
592  inline GLfloat& operator[](const unsigned int n)
593  {
594  if (n<4)
595  return m_color[n];
596  else
597  return m_color[0];
598  }
599 
600 
601  //--------------------------------------------------------------------------
608  //--------------------------------------------------------------------------
609  inline bool operator==(const cColorf& a_color)
610  {
611  if (m_color[0] != a_color[0]) { return (false); }
612  if (m_color[1] != a_color[1]) { return (false); }
613  if (m_color[2] != a_color[2]) { return (false); }
614  return (true);
615  }
616 
617 
618  //--------------------------------------------------------------------------
625  //--------------------------------------------------------------------------
626  inline bool operator!=(const cColorf& a_color)
627  {
628  if (m_color[0] != a_color[0]) { return (true); }
629  if (m_color[1] != a_color[1]) { return (true); }
630  if (m_color[2] != a_color[2]) { return (true); }
631  return (false);
632  }
633 
634 
635  //--------------------------------------------------------------------------
636  // PUBLIC METHODS - RED COLORS:
637  //--------------------------------------------------------------------------
638 
639 public:
640 
642  inline void setRedIndian() { setb(0xCD, 0x5C, 0x5C); }
643 
645  inline void setRedLightCoral() { setb(0xF0, 0x80, 0x80); }
646 
648  inline void setRedSalmon() { setb(0xFA, 0x80, 0x72); }
649 
651  inline void setRedDarkSalmon() { setb(0xE9, 0x96, 0x7A); }
652 
654  inline void setRedLightSalmon() { setb(0xFF, 0xA0, 0x7A); }
655 
657  inline void setRedCrimson() { setb(0xDC, 0x14, 0x3C); }
658 
660  inline void setRed() { setb(0xFF, 0x00, 0x00); }
661 
663  inline void setRedFireBrick() { setb(0xB2, 0x22, 0x22); }
664 
666  inline void setRedDark() { setb(0x8B, 0x00, 0x00); }
667 
668 
669  //--------------------------------------------------------------------------
670  // PUBLIC METHODS - PINK COLORS:
671  //--------------------------------------------------------------------------
672 
673 public:
674 
676  inline void setPink() { setb(0xFF, 0xC0, 0xCB); }
677 
679  inline void setPinkLight() { setb(0xFF, 0xB6, 0xC); }
680 
682  inline void setPinkHot() { setb(0xFF, 0x69, 0xB4); }
683 
685  inline void setPinkDeep() { setb(0xFF, 0x14, 0x93); }
686 
688  inline void setPinkMediumVioletRed() { setb(0xC7, 0x15, 0x85); }
689 
691  inline void setPinkPaleVioletRed() { setb(0xDB, 0x70, 0x93); }
692 
693 
694  //--------------------------------------------------------------------------
695  // PUBLIC METHODS - ORANGE COLORS:
696  //--------------------------------------------------------------------------
697 
698 public:
699 
701  inline void setOrangeLightSalmon() { setb(0xFF, 0xA0, 0x7A); }
702 
704  inline void setOrangeCoral() { setb(0xFF, 0x7F, 0x50); }
705 
707  inline void setOrangeTomato() { setb(0xFF, 0x63, 0x47); }
708 
710  inline void setOrangeRed() { setb(0xFF, 0x45, 0x00); }
711 
713  inline void setOrangeDark() { setb(0xFF, 0x8C, 0x00); }
714 
716  inline void setOrange() { setb(0xFF, 0xA5, 0x00); }
717 
718 
719  //--------------------------------------------------------------------------
720  // PUBLIC METHODS - YELLOW COLORS:
721  //--------------------------------------------------------------------------
722 
723 public:
724 
726  inline void setYellowGold() { setb(0xFF, 0xD7, 0x00); }
727 
729  inline void setYellow() { setb(0xFF, 0xFF, 0x00); }
730 
732  inline void setYellowLight() { setb(0xFF, 0xFF, 0xE0); }
733 
735  inline void setYellowLemonChiffon() { setb(0xFF, 0xFA, 0xCD); }
736 
738  inline void setYellowLightGoldenrod() { setb(0xFA, 0xFA, 0xD); }
739 
741  inline void setYellowPapayaWhip() { setb(0xFF, 0xEF, 0xD5); }
742 
744  inline void setYellowMoccasin() { setb(0xFF, 0xE4, 0xB5); }
745 
747  inline void setYellowPeachPuff() { setb(0xFF, 0xDA, 0xB9); }
748 
750  inline void setYellowPaleGoldenrod() { setb(0xEE, 0xE8, 0xAA); }
751 
753  inline void setYellowKhaki() { setb(0xF0, 0xE6, 0x8C); }
754 
756  inline void setYellowDarkKhaki() { setb(0xBD, 0xB7, 0x6B); }
757 
758 
759  //--------------------------------------------------------------------------
760  // PUBLIC METHODS - PURPLE COLORS:
761  //--------------------------------------------------------------------------
762 
763 public:
764 
766  inline void setPurpleLavender() { setb(0xE6, 0xE6, 0xFA); }
767 
769  inline void setPurpleThistle() { setb(0xD8, 0xBF, 0xD8); }
770 
772  inline void setPurplePlum() { setb(0xDD, 0xA0, 0xDD); }
773 
775  inline void setPurpleViolet() { setb(0xEE, 0x82, 0xEE); }
776 
778  inline void setPurpleOrchid() { setb(0xDA, 0x70, 0xD6); }
779 
781  inline void setPurpleFuchsia() { setb(0xFF, 0x00, 0xFF); }
782 
784  inline void setPurpleMagenta() { setb(0xFF, 0x00, 0xFF); }
785 
787  inline void setPurpleMediumOrchid() { setb(0xBA, 0x55, 0xD3); }
788 
790  inline void setPurpleMedium() { setb(0x93, 0x70, 0xDB); }
791 
793  inline void setPurpleAmethyst() { setb(0x99, 0x66, 0xCC); }
794 
796  inline void setPurpleBlueViolet() { setb(0x8A, 0x2B, 0xE2); }
797 
799  inline void setPurpleDarkViolet() { setb(0x94, 0x00, 0xD3); }
800 
802  inline void setPurpleDarkOrchid() { setb(0x99, 0x32, 0xCC); }
803 
805  inline void setPurpleDarkMagenta() { setb(0x8B, 0x00, 0x8B); }
806 
808  inline void setPurple() { setb(0x80, 0x00, 0x80); }
809 
811  inline void setPurpleIndigo() { setb(0x4B, 0x00, 0x82); }
812 
814  inline void setPurpleSlateBlue() { setb(0x6A, 0x5A, 0xCD); }
815 
817  inline void setPurpleDarkSlateBlue() { setb(0x48, 0x3D, 0x8B); }
818 
820  inline void setPurpleMediumSlateBlue() { setb(0x7B, 0x68, 0xEE); }
821 
822 
823  //--------------------------------------------------------------------------
824  // PUBLIC METHODS - GREEN COLORS:
825  //--------------------------------------------------------------------------
826 
827 public:
828 
830  inline void setGreenYellow() { setb(0xAD, 0xFF, 0x2F); }
831 
833  inline void setGreenChartreuse() { setb(0x7F, 0xFF, 0x00); }
834 
836  inline void setGreenLawn() { setb(0x7C, 0xFC, 0x00); }
837 
839  inline void setGreenLime() { setb(0x00, 0xFF, 0x00); }
840 
842  inline void setGreenLimeGreen() { setb(0x32, 0xCD, 0x32); }
843 
845  inline void setGreenPale() { setb(0x98, 0xFB, 0x98); }
846 
848  inline void setGreenLight() { setb(0x90, 0xEE, 0x90); }
849 
851  inline void setGreenMediumSpring() { setb(0x00, 0xFA, 0x9A); }
852 
854  inline void setGreenSpring() { setb(0x00, 0xFF, 0x7F); }
855 
857  inline void setGreenMediumSea() { setb(0x3C, 0xB3, 0x71); }
858 
860  inline void setGreenSea() { setb(0x2E, 0x8B, 0x57); }
861 
863  inline void setGreenForest() { setb(0x22, 0x8B, 0x22); }
864 
866  inline void setGreen() { setb(0x00, 0x80, 0x00); }
867 
869  inline void setGreenDark() { setb(0x00, 0x64, 0x00); }
870 
872  inline void setGreenYellowGreen() { setb(0x9A, 0xCD, 0x32); }
873 
875  inline void setGreenOliveDrab() { setb(0x6B, 0x8E, 0x23); }
876 
878  inline void setGreenOlive() { setb(0x80, 0x80, 0x00); }
879 
881  inline void setGreenDarkOlive() { setb(0x55, 0x6B, 0x2F); }
882 
884  inline void setGreenMediumAquamarine() { setb(0x66, 0xCD, 0xAA); }
885 
887  inline void setGreenDarkSea() { setb(0x8F, 0xBC, 0x8F); }
888 
890  inline void setGreenLightSea() { setb(0x20, 0xB2, 0xAA); }
891 
893  inline void setGreenDarkCyan() { setb(0x00, 0x8B, 0x8B); }
894 
896  inline void setGreenTeal() { setb(0x00, 0x80, 0x80); }
897 
898 
899  //--------------------------------------------------------------------------
900  // PUBLIC METHODS - BLUE COLORS:
901  //--------------------------------------------------------------------------
902 
903 public:
904 
906  inline void setBlueAqua() { setb(0x00, 0xFF, 0xFF); }
907 
909  inline void setBlueCyan() { setb(0x00, 0xFF, 0xFF); }
910 
912  inline void setBlueLightCyan() { setb(0xE0, 0xFF, 0xFF); }
913 
915  inline void setBluePaleTurquoise() { setb(0xAF, 0xEE, 0xEE); }
916 
918  inline void setBlueAquamarine() { setb(0x7F, 0xFF, 0xD4); }
919 
921  inline void setBlueTurquoise() { setb(0x40, 0xE0, 0xD0); }
922 
924  inline void setBlueMediumTurquoise() { setb(0x48, 0xD1, 0xCC); }
925 
927  inline void setBlueDarkTurquoise() { setb(0x00, 0xCE, 0xD1); }
928 
930  inline void setBlueCadet() { setb(0x5F, 0x9E, 0xA0); }
931 
933  inline void setBlueSteel() { setb(0x46, 0x82, 0xB4); }
934 
936  inline void setBlueLightSteel() { setb(0xB0, 0xC4, 0xDE); }
937 
939  inline void setBluePowder() { setb(0xB0, 0xE0, 0xE6); }
940 
942  inline void setBlueLight() { setb(0xAD, 0xD8, 0xE6); }
943 
945  inline void setBlueSky() { setb(0x87, 0xCE, 0xEB); }
946 
948  inline void setBlueLightSky() { setb(0x87, 0xCE, 0xFA); }
949 
951  inline void setBlueDeepSky() { setb(0x00, 0xBF, 0xFF); }
952 
954  inline void setBlueDodger() { setb(0x1E, 0x90, 0xFF); }
955 
957  inline void setBlueCornflower() { setb(0x64, 0x95, 0xED); }
958 
960  inline void setBlueMediumSlate() { setb(0x7B, 0x68, 0xEE); }
961 
963  inline void setBlueRoyal() { setb(0x41, 0x69, 0xE1); }
964 
966  inline void setBlue() { setb(0x00, 0x00, 0xFF); }
967 
969  inline void setBlueMedium() { setb(0x00, 0x00, 0xCD); }
970 
972  inline void setBlueDark() { setb(0x00, 0x00, 0x8B); }
973 
975  inline void setBlueNavy() { setb(0x00, 0x00, 0x80); }
976 
978  inline void setBlueMidnight() { setb(0x19, 0x19, 0x70); }
979 
980 
981  //--------------------------------------------------------------------------
982  // PUBLIC METHODS - BROWN COLORS:
983  //--------------------------------------------------------------------------
984 
985 public:
986 
988  inline void setBrownCornsilk() { setb(0xFF, 0xF8, 0xDC); }
989 
991  inline void setBrownBlanchedAlmond() { setb(0xFF, 0xEB, 0xCD); }
992 
994  inline void setBrownBisque() { setb(0xFF, 0xE4, 0xC4); }
995 
997  inline void setBrownNavajoWhite() { setb(0xFF, 0xDE, 0xAD); }
998 
1000  inline void setBrownWheat() { setb(0xF5, 0xDE, 0xB3); }
1001 
1003  inline void setBrownBurlyWood() { setb(0xDE, 0xB8, 0x87); }
1004 
1006  inline void setBrownTan() { setb(0xD2, 0xB4, 0x8C); }
1007 
1009  inline void setBrownRosy() { setb(0xBC, 0x8F, 0x8F); }
1010 
1012  inline void setBrownSandy() { setb(0xF4, 0xA4, 0x60); }
1013 
1015  inline void setBrownGoldenrod() { setb(0xDA, 0xA5, 0x20); }
1016 
1018  inline void setBrownDarkGoldenrod() { setb(0xB8, 0x86, 0x0B); }
1019 
1021  inline void setBrownPeru() { setb(0xCD, 0x85, 0x3F); }
1022 
1024  inline void setBrownChocolate() { setb(0xD2, 0x69, 0x1E); }
1025 
1027  inline void setBrownSaddle() { setb(0x8B, 0x45, 0x13); }
1028 
1030  inline void setBrownSienna() { setb(0xA0, 0x52, 0x2D); }
1031 
1033  inline void setBrown() { setb(0xA5, 0x2A, 0x2A); }
1034 
1036  inline void setBrownMaroon() { setb(0x80, 0x00, 0x00); }
1037 
1038 
1039  //--------------------------------------------------------------------------
1040  // PUBLIC METHODS - WHITE COLORS:
1041  //--------------------------------------------------------------------------
1042 
1043 public:
1044 
1046  inline void setWhite() { setb(0xFF, 0xFF, 0xFF); }
1047 
1049  inline void setWhiteSnow() { setb(0xFF, 0xFA, 0xFA); }
1050 
1052  inline void setWhiteHoneydew() { setb(0xF0, 0xFF, 0xF0); }
1053 
1055  inline void setWhiteMintCream() { setb(0xF5, 0xFF, 0xFA); }
1056 
1058  inline void setWhiteAzure() { setb(0xF0, 0xFF, 0xFF); }
1059 
1061  inline void setWhiteAliceBlue() { setb(0xF0, 0xF8, 0xFF); }
1062 
1064  inline void setWhiteGhost() { setb(0xF8, 0xF8, 0xFF); }
1065 
1067  inline void setWhiteSmoke() { setb(0xF5, 0xF5, 0xF5); }
1068 
1070  inline void setWhiteSeashell() { setb(0xFF, 0xF5, 0xEE); }
1071 
1073  inline void setWhiteBeige() { setb(0xF5, 0xF5, 0xDC); }
1074 
1076  inline void setWhiteOldLace() { setb(0xFD, 0xF5, 0xE6); }
1077 
1079  inline void setWhiteFloral() { setb(0xFF, 0xFA, 0xF0); }
1080 
1082  inline void setWhiteIvory() { setb(0xFF, 0xFF, 0xF0); }
1083 
1085  inline void setWhiteAntique() { setb(0xFA, 0xEB, 0xD7); }
1086 
1088  inline void setWhiteLinen() { setb(0xFA, 0xF0, 0xE6); }
1089 
1091  inline void setWhiteLavenderBlush() { setb(0xFF, 0xF0, 0xF5); }
1092 
1094  inline void setWhiteMistyRose() { setb(0xFF, 0xE4, 0xE1); }
1095 
1096 
1097  //--------------------------------------------------------------------------
1098  // PUBLIC METHODS - GRAY COLORS:
1099  //--------------------------------------------------------------------------
1100 
1101 public:
1102 
1104  inline void setGrayGainsboro() { setb(0xDC, 0xDC, 0xDC); }
1105 
1107  inline void setGrayLight() { setb(0xD3, 0xD3, 0xD3); }
1108 
1110  inline void setGraySilver() { setb(0xC0, 0xC0, 0xC0); }
1111 
1113  inline void setGrayDark() { setb(0xA9, 0xA9, 0xA9); }
1114 
1116  inline void setGray() { setb(0x80, 0x80, 0x80); }
1117 
1119  inline void setGrayDim() { setb(0x69, 0x69, 0x69); }
1120 
1122  inline void setGrayLightSlate() { setb(0x77, 0x88, 0x99); }
1123 
1125  inline void setGraySlate() { setb(0x70, 0x80, 0x90); }
1126 
1128  inline void setGrayDarkSlate() { setb(0x2F, 0x4F, 0x4F); }
1129 
1131  inline void setBlack() { setb(0x00, 0x00, 0x00); }
1132 
1133 
1134  //--------------------------------------------------------------------------
1135  // PUBLIC METHODS - CUSTOM GRAY COLOR:
1136  //--------------------------------------------------------------------------
1137 
1138 public:
1139 
1140  // This method sets a custom gray level.
1141  inline void setGrayLevel(const GLfloat a_level) { set(a_level, a_level, a_level); }
1142 
1143 
1144  //--------------------------------------------------------------------------
1145  // PUBLIC MEMBERS:
1146  //--------------------------------------------------------------------------
1147 
1148 public:
1149 
1151  GLfloat m_color[4];
1152 
1155 };
1156 
1157 
1158 //==============================================================================
1183 //==============================================================================
1184 struct cColorb
1185 {
1186  //--------------------------------------------------------------------------
1187  // CONSTRUCTOR & DESTRUCTOR:
1188  //--------------------------------------------------------------------------
1189 
1190 public:
1191 
1192  //--------------------------------------------------------------------------
1197  //--------------------------------------------------------------------------
1199  {
1200  // initialize color components R,G,B,A
1201  m_color[0] = 0xff;
1202  m_color[1] = 0xff;
1203  m_color[2] = 0xff;
1204  m_color[3] = 0xff;
1205  m_flag_color = false;
1206  }
1207 
1208 
1209  //--------------------------------------------------------------------------
1220  //--------------------------------------------------------------------------
1221  cColorb(const GLubyte a_red,
1222  const GLubyte a_green,
1223  const GLubyte a_blue,
1224  const GLubyte a_alpha = 0xff)
1225  {
1226  m_color[0] = a_red;
1227  m_color[1] = a_green;
1228  m_color[2] = a_blue;
1229  m_color[3] = a_alpha;
1230  m_flag_color = true;
1231  };
1232 
1233 
1234  //--------------------------------------------------------------------------
1239  //--------------------------------------------------------------------------
1240  ~cColorb() {};
1241 
1242 
1243  //--------------------------------------------------------------------------
1244  // PUBLIC METHODS:
1245  //--------------------------------------------------------------------------
1246 public:
1247 
1248 
1249  //--------------------------------------------------------------------------
1257  //--------------------------------------------------------------------------
1258  inline void setModificationFlags(const bool a_value) { m_flag_color = a_value; }
1259 
1260 
1261  //--------------------------------------------------------------------------
1268  //--------------------------------------------------------------------------
1269  inline void copyTo(cColorb& a_color)
1270  {
1271  if (m_flag_color)
1272  {
1273  a_color.set(m_color[0], m_color[1], m_color[2], m_color[3]);
1274  }
1275  }
1276 
1277 
1278  //--------------------------------------------------------------------------
1289  //--------------------------------------------------------------------------
1290  inline void set(const GLubyte a_red, const GLubyte a_green, const GLubyte a_blue,
1291  const GLubyte a_alpha = 0xff)
1292  {
1293  m_color[0] = a_red;
1294  m_color[1] = a_green;
1295  m_color[2] = a_blue;
1296  m_color[3] = a_alpha;
1297  m_flag_color = true;
1298  };
1299 
1300 
1301  //--------------------------------------------------------------------------
1312  //--------------------------------------------------------------------------
1313  inline void setf(const GLfloat a_red, const GLfloat a_green, const GLfloat a_blue,
1314  const GLfloat a_alpha = 1.0f)
1315  {
1316  m_color[0] = cColorFtoB(a_red);
1317  m_color[1] = cColorFtoB(a_green);
1318  m_color[2] = cColorFtoB(a_blue);
1319  m_color[3] = cColorFtoB(a_alpha);
1320  m_flag_color = true;
1321  };
1322 
1323 
1324  //--------------------------------------------------------------------------
1332  //--------------------------------------------------------------------------
1333  inline void setMem3(const GLubyte* a_colorRGB)
1334  {
1335  m_color[0] = a_colorRGB[0];
1336  m_color[1] = a_colorRGB[1];
1337  m_color[2] = a_colorRGB[2];
1338  m_color[3] = 0xff;
1339  m_flag_color = true;
1340  }
1341 
1342 
1343  //--------------------------------------------------------------------------
1351  //--------------------------------------------------------------------------
1352  inline void setMem4(const GLubyte* a_colorRGBA)
1353  {
1354  m_color[0] = a_colorRGBA[0];
1355  m_color[1] = a_colorRGBA[1];
1356  m_color[2] = a_colorRGBA[2];
1357  m_color[3] = a_colorRGBA[3];
1358  m_flag_color = true;
1359  }
1360 
1361 
1362  //--------------------------------------------------------------------------
1369  //--------------------------------------------------------------------------
1370  inline void setR(const GLubyte a_red)
1371  {
1372  m_color[0] = a_red;
1373  m_flag_color = true;
1374  }
1375 
1376 
1377  //--------------------------------------------------------------------------
1384  //--------------------------------------------------------------------------
1385  inline GLubyte getR() const
1386  {
1387  return(m_color[0]);
1388  }
1389 
1390 
1391  //--------------------------------------------------------------------------
1398  //--------------------------------------------------------------------------
1399  inline void setG(const GLubyte a_green)
1400  {
1401  m_color[1] = a_green;
1402  m_flag_color = true;
1403  }
1404 
1405 
1406  //--------------------------------------------------------------------------
1413  //--------------------------------------------------------------------------
1414  inline GLubyte getG() const
1415  {
1416  return(m_color[1]);
1417  }
1418 
1419 
1420  //--------------------------------------------------------------------------
1427  //--------------------------------------------------------------------------
1428  inline void setB(const GLubyte a_blue)
1429  {
1430  m_color[2] = a_blue;
1431  m_flag_color = true;
1432  }
1433 
1434 
1435  //--------------------------------------------------------------------------
1442  //--------------------------------------------------------------------------
1443  inline GLubyte getB() const
1444  {
1445  return(m_color[2]);
1446  }
1447 
1448 
1449  //--------------------------------------------------------------------------
1456  //--------------------------------------------------------------------------
1457  inline void setA(const GLubyte a_alpha)
1458  {
1459  m_color[3] = a_alpha;
1460  m_flag_color = true;
1461  }
1462 
1463 
1464  //--------------------------------------------------------------------------
1471  //--------------------------------------------------------------------------
1472  inline GLubyte getA() const
1473  {
1474  return(m_color[3]);
1475  }
1476 
1477 
1478  //--------------------------------------------------------------------------
1485  //--------------------------------------------------------------------------
1486  inline void setLuminance(const GLubyte a_luminance)
1487  {
1488  set(a_luminance, a_luminance, a_luminance);
1489  }
1490 
1491 
1492  //--------------------------------------------------------------------------
1499  //--------------------------------------------------------------------------
1500  inline GLubyte getLuminance() const
1501  {
1502  return ((GLubyte)(0.33333 * ((float)m_color[0] + (float)m_color[1] + (float)m_color[2])));
1503  }
1504 
1505 
1506  //--------------------------------------------------------------------------
1511  //--------------------------------------------------------------------------
1512  inline void render() const
1513  {
1514  #ifdef C_USE_OPENGL
1515  glColor4bv((const signed char*)(&m_color[0]));
1516  #endif
1517  };
1518 
1519 
1520  //--------------------------------------------------------------------------
1527  //--------------------------------------------------------------------------
1528  inline const GLubyte* getData() const
1529  {
1530  return (&m_color[0]);
1531  }
1532 
1533 
1534  //--------------------------------------------------------------------------
1541  //--------------------------------------------------------------------------
1542  cColorf getColorf() const;
1543 
1544 
1545  //--------------------------------------------------------------------------
1552  //--------------------------------------------------------------------------
1553  inline GLubyte operator[](const unsigned int n) const
1554  {
1555  if (n<4)
1556  return (m_color[n]);
1557  else
1558  return (0x00);
1559  }
1560 
1561 
1562  //--------------------------------------------------------------------------
1569  //--------------------------------------------------------------------------
1570  inline GLubyte& operator[](const unsigned int n)
1571  {
1572  if (n<4)
1573  return m_color[n];
1574  else
1575  return m_color[0];
1576  }
1577 
1578 
1579  //--------------------------------------------------------------------------
1586  //--------------------------------------------------------------------------
1587  inline bool operator==(const cColorb& a_color)
1588  {
1589  if (m_color[0] != a_color[0]) { return (false); }
1590  if (m_color[1] != a_color[1]) { return (false); }
1591  if (m_color[2] != a_color[2]) { return (false); }
1592  return (true);
1593  }
1594 
1595 
1596  //--------------------------------------------------------------------------
1603  //--------------------------------------------------------------------------
1604  inline bool operator!=(const cColorb& a_color)
1605  {
1606  if (m_color[0] != a_color[0]) { return (true); }
1607  if (m_color[1] != a_color[1]) { return (true); }
1608  if (m_color[2] != a_color[2]) { return (true); }
1609  return (false);
1610  }
1611 
1612 
1613  //--------------------------------------------------------------------------
1614  // PUBLIC METHODS - RED COLORS:
1615  //--------------------------------------------------------------------------
1616 
1617 public:
1618 
1620  inline void setRedIndian() { set(0xCD, 0x5C, 0x5C); }
1621 
1623  inline void setRedLightCoral() { set(0xF0, 0x80, 0x80); }
1624 
1626  inline void setRedSalmon() { set(0xFA, 0x80, 0x72); }
1627 
1629  inline void setRedDarkSalmon() { set(0xE9, 0x96, 0x7A); }
1630 
1632  inline void setRedLightSalmon() { set(0xFF, 0xA0, 0x7A); }
1633 
1635  inline void setRedCrimson() { set(0xDC, 0x14, 0x3C); }
1636 
1638  inline void setRed() { set(0xFF, 0x00, 0x00); }
1639 
1641  inline void setRedFireBrick() { set(0xB2, 0x22, 0x22); }
1642 
1644  inline void setRedDark() { set(0x8B, 0x00, 0x00); }
1645 
1646 
1647  //--------------------------------------------------------------------------
1648  // PUBLIC METHODS - PINK COLORS:
1649  //--------------------------------------------------------------------------
1650 
1651 public:
1652 
1654  inline void setPink() { set(0xFF, 0xC0, 0xCB); }
1655 
1657  inline void setPinkLight() { set(0xFF, 0xB6, 0xC); }
1658 
1660  inline void setPinkHot() { set(0xFF, 0x69, 0xB4); }
1661 
1663  inline void setPinkDeep() { set(0xFF, 0x14, 0x93); }
1664 
1666  inline void setPinkMediumVioletRed() { set(0xC7, 0x15, 0x85); }
1667 
1669  inline void setPinkPaleVioletRed() { set(0xDB, 0x70, 0x93); }
1670 
1671 
1672  //--------------------------------------------------------------------------
1673  // PUBLIC METHODS - ORANGE COLORS:
1674  //--------------------------------------------------------------------------
1675 
1676 public:
1677 
1679  inline void setOrangeLightSalmon() { set(0xFF, 0xA0, 0x7A); }
1680 
1682  inline void setOrangeCoral() { set(0xFF, 0x7F, 0x50); }
1683 
1685  inline void setOrangeTomato() { set(0xFF, 0x63, 0x47); }
1686 
1688  inline void setOrangeRed() { set(0xFF, 0x45, 0x00); }
1689 
1691  inline void setOrangeDark() { set(0xFF, 0x8C, 0x00); }
1692 
1694  inline void setOrange() { set(0xFF, 0xA5, 0x00); }
1695 
1696 
1697  //--------------------------------------------------------------------------
1698  // PUBLIC METHODS - YELLOW COLORS:
1699  //--------------------------------------------------------------------------
1700 
1701 public:
1702 
1704  inline void setYellowGold() { set(0xFF, 0xD7, 0x00); }
1705 
1707  inline void setYellow() { set(0xFF, 0xFF, 0x00); }
1708 
1710  inline void setYellowLight() { set(0xFF, 0xFF, 0xE0); }
1711 
1713  inline void setYellowLemonChiffon() { set(0xFF, 0xFA, 0xCD); }
1714 
1716  inline void setYellowLightGoldenrod() { set(0xFA, 0xFA, 0xD); }
1717 
1719  inline void setYellowPapayaWhip() { set(0xFF, 0xEF, 0xD5); }
1720 
1722  inline void setYellowMoccasin() { set(0xFF, 0xE4, 0xB5); }
1723 
1725  inline void setYellowPeachPuff() { set(0xFF, 0xDA, 0xB9); }
1726 
1728  inline void setYellowPaleGoldenrod() { set(0xEE, 0xE8, 0xAA); }
1729 
1731  inline void setYellowKhaki() { set(0xF0, 0xE6, 0x8C); }
1732 
1734  inline void setYellowDarkKhaki() { set(0xBD, 0xB7, 0x6B); }
1735 
1736 
1737  //--------------------------------------------------------------------------
1738  // PUBLIC METHODS - PURPLE COLORS:
1739  //--------------------------------------------------------------------------
1740 
1741 public:
1742 
1744  inline void setPurpleLavender() { set(0xE6, 0xE6, 0xFA); }
1745 
1747  inline void setPurpleThistle() { set(0xD8, 0xBF, 0xD8); }
1748 
1750  inline void setPurplePlum() { set(0xDD, 0xA0, 0xDD); }
1751 
1753  inline void setPurpleViolet() { set(0xEE, 0x82, 0xEE); }
1754 
1756  inline void setPurpleOrchid() { set(0xDA, 0x70, 0xD6); }
1757 
1759  inline void setPurpleFuchsia() { set(0xFF, 0x00, 0xFF); }
1760 
1762  inline void setPurpleMagenta() { set(0xFF, 0x00, 0xFF); }
1763 
1765  inline void setPurpleMediumOrchid() { set(0xBA, 0x55, 0xD3); }
1766 
1768  inline void setPurpleMedium() { set(0x93, 0x70, 0xDB); }
1769 
1771  inline void setPurpleAmethyst() { set(0x99, 0x66, 0xCC); }
1772 
1774  inline void setPurpleBlueViolet() { set(0x8A, 0x2B, 0xE2); }
1775 
1777  inline void setPurpleDarkViolet() { set(0x94, 0x00, 0xD3); }
1778 
1780  inline void setPurpleDarkOrchid() { set(0x99, 0x32, 0xCC); }
1781 
1783  inline void setPurpleDarkMagenta() { set(0x8B, 0x00, 0x8B); }
1784 
1786  inline void setPurple() { set(0x80, 0x00, 0x80); }
1787 
1789  inline void setPurpleIndigo() { set(0x4B, 0x00, 0x82); }
1790 
1792  inline void setPurpleSlateBlue() { set(0x6A, 0x5A, 0xCD); }
1793 
1795  inline void setPurpleDarkSlateBlue() { set(0x48, 0x3D, 0x8B); }
1796 
1798  inline void setPurpleMediumSlateBlue() { set(0x7B, 0x68, 0xEE); }
1799 
1800 
1801  //--------------------------------------------------------------------------
1802  // PUBLIC METHODS - GREEN COLORS:
1803  //--------------------------------------------------------------------------
1804 
1805 public:
1806 
1808  inline void setGreenYellow() { set(0xAD, 0xFF, 0x2F); }
1809 
1811  inline void setGreenChartreuse() { set(0x7F, 0xFF, 0x00); }
1812 
1814  inline void setGreenLawn() { set(0x7C, 0xFC, 0x00); }
1815 
1817  inline void setGreenLime() { set(0x00, 0xFF, 0x00); }
1818 
1820  inline void setGreenLimeGreen() { set(0x32, 0xCD, 0x32); }
1821 
1823  inline void setGreenPale() { set(0x98, 0xFB, 0x98); }
1824 
1826  inline void setGreenLight() { set(0x90, 0xEE, 0x90); }
1827 
1829  inline void setGreenMediumSpring() { set(0x00, 0xFA, 0x9A); }
1830 
1832  inline void setGreenSpring() { set(0x00, 0xFF, 0x7F); }
1833 
1835  inline void setGreenMediumSea() { set(0x3C, 0xB3, 0x71); }
1836 
1838  inline void setGreenSea() { set(0x2E, 0x8B, 0x57); }
1839 
1841  inline void setGreenForest() { set(0x22, 0x8B, 0x22); }
1842 
1844  inline void setGreen() { set(0x00, 0x80, 0x00); }
1845 
1847  inline void setGreenDark() { set(0x00, 0x64, 0x00); }
1848 
1850  inline void setGreenYellowGreen() { set(0x9A, 0xCD, 0x32); }
1851 
1853  inline void setGreenOliveDrab() { set(0x6B, 0x8E, 0x23); }
1854 
1856  inline void setGreenOlive() { set(0x80, 0x80, 0x00); }
1857 
1859  inline void setGreenDarkOlive() { set(0x55, 0x6B, 0x2F); }
1860 
1862  inline void setGreenMediumAquamarine() { set(0x66, 0xCD, 0xAA); }
1863 
1865  inline void setGreenDarkSea() { set(0x8F, 0xBC, 0x8F); }
1866 
1868  inline void setGreenLightSea() { set(0x20, 0xB2, 0xAA); }
1869 
1871  inline void setGreenDarkCyan() { set(0x00, 0x8B, 0x8B); }
1872 
1874  inline void setGreenTeal() { set(0x00, 0x80, 0x80); }
1875 
1876 
1877  //--------------------------------------------------------------------------
1878  // PUBLIC METHODS - BLUE COLORS
1879  //--------------------------------------------------------------------------
1880 
1881 public:
1882 
1884  inline void setBlueAqua() { set(0x00, 0xFF, 0xFF); }
1885 
1887  inline void setBlueCyan() { set(0x00, 0xFF, 0xFF); }
1888 
1890  inline void setBlueLightCyan() { set(0xE0, 0xFF, 0xFF); }
1891 
1893  inline void setBluePaleTurquoise() { set(0xAF, 0xEE, 0xEE); }
1894 
1896  inline void setBlueAquamarine() { set(0x7F, 0xFF, 0xD4); }
1897 
1899  inline void setBlueTurquoise() { set(0x40, 0xE0, 0xD0); }
1900 
1902  inline void setBlueMediumTurquoise() { set(0x48, 0xD1, 0xCC); }
1903 
1905  inline void setBlueDarkTurquoise() { set(0x00, 0xCE, 0xD1); }
1906 
1908  inline void setBlueCadet() { set(0x5F, 0x9E, 0xA0); }
1909 
1911  inline void setBlueSteel() { set(0x46, 0x82, 0xB4); }
1912 
1914  inline void setBlueLightSteel() { set(0xB0, 0xC4, 0xDE); }
1915 
1917  inline void setBluePowder() { set(0xB0, 0xE0, 0xE6); }
1918 
1920  inline void setBlueLight() { set(0xAD, 0xD8, 0xE6); }
1921 
1923  inline void setBlueSky() { set(0x87, 0xCE, 0xEB); }
1924 
1926  inline void setBlueLightSky() { set(0x87, 0xCE, 0xFA); }
1927 
1929  inline void setBlueDeepSky() { set(0x00, 0xBF, 0xFF); }
1930 
1932  inline void setBlueDodger() { set(0x1E, 0x90, 0xFF); }
1933 
1935  inline void setBlueCornflower() { set(0x64, 0x95, 0xED); }
1936 
1938  inline void setBlueMediumSlate() { set(0x7B, 0x68, 0xEE); }
1939 
1941  inline void setBlueRoyal() { set(0x41, 0x69, 0xE1); }
1942 
1944  inline void setBlue() { set(0x00, 0x00, 0xFF); }
1945 
1947  inline void setBlueMedium() { set(0x00, 0x00, 0xCD); }
1948 
1950  inline void setBlueDark() { set(0x00, 0x00, 0x8B); }
1951 
1953  inline void setBlueNavy() { set(0x00, 0x00, 0x80); }
1954 
1956  inline void setBlueMidnight() { set(0x19, 0x19, 0x70); }
1957 
1958 
1959  //--------------------------------------------------------------------------
1960  // PUBLIC METHODS - BROWN COLORS:
1961  //--------------------------------------------------------------------------
1962 
1963 public:
1964 
1966  inline void setBrownCornsilk() { set(0xFF, 0xF8, 0xDC); }
1967 
1969  inline void setBrownBlanchedAlmond() { set(0xFF, 0xEB, 0xCD); }
1970 
1972  inline void setBrownBisque() { set(0xFF, 0xE4, 0xC4); }
1973 
1975  inline void setBrownNavajoWhite() { set(0xFF, 0xDE, 0xAD); }
1976 
1978  inline void setBrownWheat() { set(0xF5, 0xDE, 0xB3); }
1979 
1981  inline void setBrownBurlyWood() { set(0xDE, 0xB8, 0x87); }
1982 
1984  inline void setBrownTan() { set(0xD2, 0xB4, 0x8C); }
1985 
1987  inline void setBrownRosy() { set(0xBC, 0x8F, 0x8F); }
1988 
1990  inline void setBrownSandy() { set(0xF4, 0xA4, 0x60); }
1991 
1993  inline void setBrownGoldenrod() { set(0xDA, 0xA5, 0x20); }
1994 
1996  inline void setBrownDarkGoldenrod() { set(0xB8, 0x86, 0x0B); }
1997 
1999  inline void setBrownPeru() { set(0xCD, 0x85, 0x3F); }
2000 
2002  inline void setBrownChocolate() { set(0xD2, 0x69, 0x1E); }
2003 
2005  inline void setBrownSaddle() { set(0x8B, 0x45, 0x13); }
2006 
2008  inline void setBrownSienna() { set(0xA0, 0x52, 0x2D); }
2009 
2011  inline void setBrown() { set(0xA5, 0x2A, 0x2A); }
2012 
2014  inline void setBrownMaroon() { set(0x80, 0x00, 0x00); }
2015 
2016 
2017  //--------------------------------------------------------------------------
2018  // PUBLIC METHODS - WHITE COLORS:
2019  //--------------------------------------------------------------------------
2020 
2021 public:
2022 
2024  inline void setWhite() { set(0xFF, 0xFF, 0xFF); }
2025 
2027  inline void setWhiteSnow() { set(0xFF, 0xFA, 0xFA); }
2028 
2030  inline void setWhiteHoneydew() { set(0xF0, 0xFF, 0xF0); }
2031 
2033  inline void setWhiteMintCream() { set(0xF5, 0xFF, 0xFA); }
2034 
2036  inline void setWhiteAzure() { set(0xF0, 0xFF, 0xFF); }
2037 
2039  inline void setWhiteAliceBlue() { set(0xF0, 0xF8, 0xFF); }
2040 
2042  inline void setWhiteGhost() { set(0xF8, 0xF8, 0xFF); }
2043 
2045  inline void setWhiteSmoke() { set(0xF5, 0xF5, 0xF5); }
2046 
2048  inline void setWhiteSeashell() { set(0xFF, 0xF5, 0xEE); }
2049 
2051  inline void setWhiteBeige() { set(0xF5, 0xF5, 0xDC); }
2052 
2054  inline void setWhiteOldLace() { set(0xFD, 0xF5, 0xE6); }
2055 
2057  inline void setWhiteFloral() { set(0xFF, 0xFA, 0xF0); }
2058 
2060  inline void setWhiteIvory() { set(0xFF, 0xFF, 0xF0); }
2061 
2063  inline void setWhiteAntique() { set(0xFA, 0xEB, 0xD7); }
2064 
2066  inline void setWhiteLinen() { set(0xFA, 0xF0, 0xE6); }
2067 
2069  inline void setWhiteLavenderBlush() { set(0xFF, 0xF0, 0xF5); }
2070 
2072  inline void setWhiteMistyRose() { set(0xFF, 0xE4, 0xE1); }
2073 
2074 
2075  //--------------------------------------------------------------------------
2076  // PUBLIC METHODS - GRAY COLORS:
2077  //--------------------------------------------------------------------------
2078 
2079 public:
2080 
2082  inline void setGrayGainsboro() { set(0xDC, 0xDC, 0xDC); }
2083 
2085  inline void setGrayLight() { set(0xD3, 0xD3, 0xD3); }
2086 
2088  inline void setGraySilver() { set(0xC0, 0xC0, 0xC0); }
2089 
2091  inline void setGrayDark() { set(0xA9, 0xA9, 0xA9); }
2092 
2094  inline void setGray() { set(0x80, 0x80, 0x80); }
2095 
2097  inline void setGrayDim() { set(0x69, 0x69, 0x69); }
2098 
2100  inline void setGrayLightSlate() { set(0x77, 0x88, 0x99); }
2101 
2103  inline void setGraySlate() { set(0x70, 0x80, 0x90); }
2104 
2106  inline void setGrayDarkSlate() { set(0x2F, 0x4F, 0x4F); }
2107 
2109  inline void setBlack() { set(0x00, 0x00, 0x00); }
2110 
2111 
2112  //--------------------------------------------------------------------------
2113  // PUBLIC METHODS - CUSTOM GRAY COLOR
2114  //--------------------------------------------------------------------------
2115 
2116 public:
2117 
2118  // This method set a custom gray level.
2119  inline void setGrayLevel(const GLubyte a_level) { set(a_level, a_level, a_level); }
2120 
2121 
2122  //--------------------------------------------------------------------------
2123  // PUBLIC MEMBERS:
2124  //--------------------------------------------------------------------------
2125 
2126 public:
2127 
2129  GLubyte m_color[4];
2130 
2133 };
2134 
2135 //------------------------------------------------------------------------------
2136 } // namespace chai3d
2137 //------------------------------------------------------------------------------
2138 
2139 //------------------------------------------------------------------------------
2140 #endif
2141 //------------------------------------------------------------------------------
2142 
GLubyte getR() const
This method returns the red component.
Definition: CColor.h:1385
void setOrange()
This method sets the color to Orange.
Definition: CColor.h:1694
void setWhiteIvory()
This method sets the color to Ivory.
Definition: CColor.h:1082
void setGreenDark()
This method sets the color to Dark Green.
Definition: CColor.h:1847
void setGreenDarkOlive()
This method sets the color to Dark Olive Green.
Definition: CColor.h:1859
void setGreenLime()
This method sets the color to Lime.
Definition: CColor.h:839
void setPurplePlum()
This method sets the color to Plum.
Definition: CColor.h:772
void setGreenPale()
This method sets the color to Pale Green.
Definition: CColor.h:845
void setPurpleAmethyst()
This method sets the color to Amethyst.
Definition: CColor.h:1771
void setPurpleDarkMagenta()
This method sets the color to Dark Magenta.
Definition: CColor.h:1783
void set(const GLfloat a_red, const GLfloat a_green, const GLfloat a_blue, const GLfloat a_alpha)
This method sets the color by passing its RGBA components as GLfloat parameters.
Definition: CColor.h:244
void setBlueRoyal()
This method sets the color to Royal Blue.
Definition: CColor.h:1941
void setGreenDarkCyan()
This method sets the color to Dark Cyan.
Definition: CColor.h:893
void setPurpleFuchsia()
This method sets the color to Fuchsia.
Definition: CColor.h:781
void setGreenMediumSpring()
This method sets the color to Medium Spring Green.
Definition: CColor.h:1829
void setGreenYellowGreen()
This method sets the color to Yellow Green.
Definition: CColor.h:872
void setWhiteSmoke()
This method sets the color to White Smoke.
Definition: CColor.h:2045
Implements general math utility functions.
void setOrange()
This method sets the color to Orange.
Definition: CColor.h:716
void setYellowLemonChiffon()
This method sets the color to Lemon Chiffon.
Definition: CColor.h:735
GLfloat & operator[](const unsigned int n)
This operator returns the n-th component of this color (we provide both const and non-const versions ...
Definition: CColor.h:592
void setWhiteFloral()
This method sets the color to Floral White.
Definition: CColor.h:2057
void setOrangeRed()
This method sets the color to Orange Red.
Definition: CColor.h:710
void setRedLightCoral()
This method sets the color to Light Coral Red.
Definition: CColor.h:1623
GLubyte operator[](const unsigned int n) const
This operator returns the n-th component of this color (we provide both const and non-const versions ...
Definition: CColor.h:1553
void setBlueMediumSlate()
This method sets the color to Medium Slate Blue.
Definition: CColor.h:960
void setPurpleMagenta()
This method sets the color to Magenta.
Definition: CColor.h:1762
void setBlueLight()
This method sets the color to Light Blue.
Definition: CColor.h:942
void setWhiteSmoke()
This method sets the color to White Smoke.
Definition: CColor.h:1067
void setWhiteOldLace()
This method sets the color to Old Lace.
Definition: CColor.h:2054
void setRedDarkSalmon()
This method sets the color to Dark Red Salmon.
Definition: CColor.h:1629
void setPurpleBlueViolet()
This method sets the color to Blue Violet.
Definition: CColor.h:1774
void setGreenMediumSea()
This method sets the color to Medium Sea Green.
Definition: CColor.h:1835
void setGreenMediumSea()
This method sets the color to Medium Sea Green.
Definition: CColor.h:857
void setPurplePlum()
This method sets the color to Plum.
Definition: CColor.h:1750
void setBrownWheat()
This method sets the color to Wheat.
Definition: CColor.h:1000
void setBrownChocolate()
This method sets the color to Chocolate.
Definition: CColor.h:1024
void setBlueNavy()
This method sets the color to Navy.
Definition: CColor.h:1953
void setBlueNavy()
This method sets the color to Navy.
Definition: CColor.h:975
void setBrownBisque()
This method sets the color to Bisque.
Definition: CColor.h:994
void setRedFireBrick()
This method sets the color to Red Fire Brick.
Definition: CColor.h:663
void setBrownSienna()
This method sets the color to Sienna.
Definition: CColor.h:1030
void setGrayDarkSlate()
This method sets the color to Dark Slate Gray.
Definition: CColor.h:1128
void setGreenLimeGreen()
This method sets the color to Lime Green.
Definition: CColor.h:1820
void setBlueSteel()
This method sets the color to Steel Blue.
Definition: CColor.h:933
void setGreenYellow()
This method sets the color to Green Yellow.
Definition: CColor.h:1808
void setBrownBurlyWood()
This method sets the color to Burly Wood.
Definition: CColor.h:1981
void setPurpleSlateBlue()
This method sets the color to Slate Blue.
Definition: CColor.h:814
cColorb(const GLubyte a_red, const GLubyte a_green, const GLubyte a_blue, const GLubyte a_alpha=0xff)
Constructor of cColorb. Define a color by passing its RGBA components as parameters.
Definition: CColor.h:1221
void setPurpleDarkMagenta()
This method sets the color to Dark Magenta.
Definition: CColor.h:805
void setWhiteGhost()
This method sets the color to Ghost White.
Definition: CColor.h:1064
bool operator!=(const cColorf &a_color)
This operator compares two colors and returns false if the color components RGB are identical...
Definition: CColor.h:626
void setGraySilver()
This method sets the color to Silver.
Definition: CColor.h:2088
void setBlueLightSky()
This method sets the color to Light Sky Blue.
Definition: CColor.h:1926
void setYellowKhaki()
This method sets the color to Khaki.
Definition: CColor.h:1731
void setGreenLawn()
This method sets the color to Lawn Green.
Definition: CColor.h:836
void setGreen()
This method sets the color to Green.
Definition: CColor.h:1844
void setBlue()
This method sets the color to Blue.
Definition: CColor.h:966
void setPink()
This method sets the color to Pink.
Definition: CColor.h:676
void setPurpleViolet()
This method sets the color to Violet.
Definition: CColor.h:1753
void setYellowPaleGoldenrod()
This method sets the color to Pale Goldenrod.
Definition: CColor.h:1728
void setRed()
This method sets the color to Red.
Definition: CColor.h:1638
void setOrangeDark()
This method sets the color to Dark Orange.
Definition: CColor.h:1691
bool operator==(const cColorf &a_color)
This operator compares two colors and returns true if the color components RGB are identical...
Definition: CColor.h:609
void setGrayLightSlate()
This method sets the color to Light Slate Gray.
Definition: CColor.h:1122
void setGreenYellow()
This method sets the color to Green Yellow.
Definition: CColor.h:830
void setMem4(const GLfloat *a_colorRGBA)
This method sets the color by copying four GLfloat from an array, each describing one of the RGBA com...
Definition: CColor.h:372
void setPurpleSlateBlue()
This method sets the color to Slate Blue.
Definition: CColor.h:1792
void setPurpleDarkSlateBlue()
This method sets the color to Dark Slate Blue.
Definition: CColor.h:817
void setWhiteBeige()
This method sets the color to Beige.
Definition: CColor.h:1073
void setBlueMidnight()
This method sets the color to Midnight Blue.
Definition: CColor.h:978
void setBlueCadet()
This method sets the color to Cadet Blue.
Definition: CColor.h:1908
void setBlueAquamarine()
This method sets the color to Aquamarine.
Definition: CColor.h:918
void setBrownSienna()
This method sets the color to Sienna.
Definition: CColor.h:2008
void setR(const GLubyte a_red)
This method sets the red component.
Definition: CColor.h:1370
void setYellowLight()
This method sets the color to Light Yellow.
Definition: CColor.h:1710
void setRedLightCoral()
This method sets the color to Light Coral Red.
Definition: CColor.h:645
void setGrayLight()
This method sets the color to Light Gray.
Definition: CColor.h:1107
void setBlueDeepSky()
This method sets the color to Deep Sky Blue.
Definition: CColor.h:951
void setWhiteHoneydew()
This method sets the color to Honeydew.
Definition: CColor.h:2030
void setPurpleDarkOrchid()
This method sets the color to Dark Orchid.
Definition: CColor.h:802
void setBrownCornsilk()
This method sets the color to Cornsilk.
Definition: CColor.h:1966
void setPurple()
This method sets the color to Purple.
Definition: CColor.h:808
void setBrownBurlyWood()
This method sets the color to Burly Wood.
Definition: CColor.h:1003
void setWhiteMistyRose()
This method sets the color to Misty Rose.
Definition: CColor.h:2072
void setYellowLightGoldenrod()
This method sets the color to Light Goldenrod.
Definition: CColor.h:1716
void setBlueMediumTurquoise()
This method sets the color to Medium Turquoise.
Definition: CColor.h:924
void setWhiteAliceBlue()
This method sets the color to Alice Blue.
Definition: CColor.h:1061
void setGreenTeal()
This method sets the color to Teal.
Definition: CColor.h:896
void setGreenOliveDrab()
This method sets the color to Olive Drab.
Definition: CColor.h:875
void setBlueSky()
This method sets the color to Sky Blue.
Definition: CColor.h:945
void setBlueMidnight()
This method sets the color to Midnight Blue.
Definition: CColor.h:1956
~cColorf()
Definition: CColor.h:194
void setBlueAqua()
This method sets the color to Aqua.
Definition: CColor.h:906
void setYellowGold()
This method sets the color to Gold.
Definition: CColor.h:1704
void setGreenLight()
This method sets the color to Light Green.
Definition: CColor.h:848
void setGreenLight()
This method sets the color to Light Green.
Definition: CColor.h:1826
void setWhiteMintCream()
This method sets the color to Mint Cream.
Definition: CColor.h:2033
GLubyte cColorFtoB(GLfloat a_value)
This function converts a color component from GLfloat type to GLubyte type.
Definition: CColor.h:93
void setBrownBlanchedAlmond()
This method sets the color to Blanched Almond.
Definition: CColor.h:991
void setBlack()
This method sets the color to Black.
Definition: CColor.h:1131
void setPurpleOrchid()
This method sets the color to Orchid.
Definition: CColor.h:1756
void setWhiteAntique()
This method sets the color to Antique White.
Definition: CColor.h:2063
void setPinkDeep()
This method sets the color to Deep Pink.
Definition: CColor.h:685
void setModificationFlags(const bool a_value)
This method is used to mark the color as modified.
Definition: CColor.h:212
void setGreenSea()
This method sets the color to Sea Green.
Definition: CColor.h:860
void setGraySlate()
This method sets the color to Slate Gray.
Definition: CColor.h:2103
void setBluePaleTurquoise()
This method sets the color to Pale Turquoise.
Definition: CColor.h:1893
void setOrangeCoral()
This method sets the color to Orange Coral.
Definition: CColor.h:704
GLubyte getG() const
This method returns the green component.
Definition: CColor.h:1414
void setBlueCyan()
This method sets the color to Cyan.
Definition: CColor.h:1887
void setGreenDarkSea()
This method sets the color to Dark Sea Green.
Definition: CColor.h:1865
void setBlueMediumTurquoise()
This method sets the color to Medium Turquoise.
Definition: CColor.h:1902
void setBrownCornsilk()
This method sets the color to Cornsilk.
Definition: CColor.h:988
void setPurpleBlueViolet()
This method sets the color to Blue Violet.
Definition: CColor.h:796
void setRedSalmon()
This method sets the color to Red Salmon.
Definition: CColor.h:648
void setWhiteAntique()
This method sets the color to Antique White.
Definition: CColor.h:1085
void set(const GLubyte a_red, const GLubyte a_green, const GLubyte a_blue, const GLubyte a_alpha=0xff)
This method sets the color by passing its RGBA components as parameters in GLubyte format...
Definition: CColor.h:1290
void setYellowMoccasin()
This method sets the color to Moccasin.
Definition: CColor.h:1722
void copyTo(cColorf &a_color)
This method copies this color to another if it has been marked.
Definition: CColor.h:223
void setPinkPaleVioletRed()
This method sets the color to Pale Violet Red.
Definition: CColor.h:691
GLfloat getR() const
This method returns the red component.
Definition: CColor.h:405
void setGreenOlive()
This method sets the color to Olive.
Definition: CColor.h:878
void setBlueRoyal()
This method sets the color to Royal Blue.
Definition: CColor.h:963
void setB(const GLubyte a_blue)
This method sets the blue component.
Definition: CColor.h:1428
void setBlueLightCyan()
This method sets the color to Light Cyan.
Definition: CColor.h:912
void setRedLightSalmon()
This method sets the color to Light Red Salmon.
Definition: CColor.h:654
void setA(const GLfloat a_alpha)
This method sets the alpha component.
Definition: CColor.h:477
void setOrangeTomato()
This method sets the color to Orange Tomato.
Definition: CColor.h:707
void setGray()
This method sets the color to Gray.
Definition: CColor.h:1116
void setGreenSpring()
This method sets the color to Spring Green.
Definition: CColor.h:1832
void setG(const GLubyte a_green)
This method sets the green component.
Definition: CColor.h:1399
void setPurpleMediumOrchid()
This method sets the color to Medium Orchid.
Definition: CColor.h:787
void setGreenLimeGreen()
This method sets the color to Lime Green.
Definition: CColor.h:842
void setYellowLemonChiffon()
This method sets the color to Lemon Chiffon.
Definition: CColor.h:1713
void setBlueMedium()
This method sets the color to Medium Blue.
Definition: CColor.h:969
void setPurpleThistle()
This method sets the color to Thistle.
Definition: CColor.h:769
void setBlack()
This method sets the color to Black.
Definition: CColor.h:2109
void setGreenDarkOlive()
This method sets the color to Dark Olive Green.
Definition: CColor.h:881
void setYellowLightGoldenrod()
This method sets the color to Light Goldenrod.
Definition: CColor.h:738
void setGreenLawn()
This method sets the color to Lawn Green.
Definition: CColor.h:1814
void setGraySilver()
This method sets the color to Silver.
Definition: CColor.h:1110
void setPurple()
This method sets the color to Purple.
Definition: CColor.h:1786
bool operator!=(const cColorb &a_color)
This operator compares two colors and returns false if the color components RGB are identical...
Definition: CColor.h:1604
void setBrownRosy()
This method sets the color to Rosy Brown.
Definition: CColor.h:1009
void setGrayDark()
This method sets the color to Dark Gray.
Definition: CColor.h:1113
void setPurpleMedium()
This method sets the color to Medium Purple.
Definition: CColor.h:1768
void setGreenForest()
This method sets the color to Forest Green.
Definition: CColor.h:1841
void setBlueCyan()
This method sets the color to Cyan.
Definition: CColor.h:909
void setPurpleMediumOrchid()
This method sets the color to Medium Orchid.
Definition: CColor.h:1765
void setGrayDim()
This method sets the color to Dim Gray.
Definition: CColor.h:2097
void setWhiteIvory()
This method sets the color to Ivory.
Definition: CColor.h:2060
void setOrangeLightSalmon()
This method sets the color to Orange Light Salmon.
Definition: CColor.h:701
void setPurpleMagenta()
This method sets the color to Magenta.
Definition: CColor.h:784
void setWhiteSnow()
This method sets the color to White Snow.
Definition: CColor.h:1049
void setBlueCornflower()
This method sets the color to Cornflower Blue.
Definition: CColor.h:957
void setWhite()
This method sets the color to White.
Definition: CColor.h:1046
void setG(const GLfloat a_green)
This method sets the green component.
Definition: CColor.h:419
void setPinkLight()
This method sets the color to Light Pink.
Definition: CColor.h:1657
void setGreenSea()
This method sets the color to Sea Green.
Definition: CColor.h:1838
GLubyte getB() const
This method returns the blue component.
Definition: CColor.h:1443
void setWhite()
This method sets the color to White.
Definition: CColor.h:2024
void setYellowLight()
This method sets the color to Light Yellow.
Definition: CColor.h:732
void setGrayDim()
This method sets the color to Dim Gray.
Definition: CColor.h:1119
void setBlue()
This method sets the color to Blue.
Definition: CColor.h:1944
void setBlueDodger()
This method sets the color to Doger Blue.
Definition: CColor.h:954
void setBlueDark()
This method sets the color to Dark Blue.
Definition: CColor.h:1950
void setGrayDark()
This method sets the color to Dark Gray.
Definition: CColor.h:2091
void setPinkMediumVioletRed()
This method sets the color to Medium Violet Red.
Definition: CColor.h:688
void mul(const GLfloat a_scale)
This method multiplies each RGB component by a scale factor a_scale passed as argument.
Definition: CColor.h:335
void setBrownSaddle()
This method sets the color to Saddle Brown.
Definition: CColor.h:1027
void setPurpleDarkViolet()
This method sets the color to Dark Violet.
Definition: CColor.h:1777
void setPurpleDarkSlateBlue()
This method sets the color to Dark Slate Blue.
Definition: CColor.h:1795
This class defines a color using a GLubyte representation for each component.
Definition: CColor.h:1184
void setPurpleMedium()
This method sets the color to Medium Purple.
Definition: CColor.h:790
void setYellowPeachPuff()
This method sets the color to Peach Puff.
Definition: CColor.h:1725
void setWhiteOldLace()
This method sets the color to Old Lace.
Definition: CColor.h:1076
void setWhiteFloral()
This method sets the color to Floral White.
Definition: CColor.h:1079
void setYellowMoccasin()
This method sets the color to Moccasin.
Definition: CColor.h:744
void setBlueLightSteel()
This method sets the color to Light Steel Blue.
Definition: CColor.h:1914
void setModificationFlags(const bool a_value)
This method is used to mark the color as modified.
Definition: CColor.h:1258
void setYellowKhaki()
This method sets the color to Khaki.
Definition: CColor.h:753
void setBlueDeepSky()
This method sets the color to Deep Sky Blue.
Definition: CColor.h:1929
void setWhiteAzure()
This method sets the color to Azure.
Definition: CColor.h:2036
void setBrownMaroon()
This method sets the color to Maroon.
Definition: CColor.h:2014
void setBrownTan()
This method sets the color to Tan.
Definition: CColor.h:1984
GLfloat getLuminance() const
This method returns the luminance value of this color.
Definition: CColor.h:520
void setGreenLightSea()
This method sets the color to Light Sea Green.
Definition: CColor.h:1868
GLfloat getA() const
This method returns the alpha component.
Definition: CColor.h:492
void setBrownDarkGoldenrod()
This method sets the color to Dark Brown Goldenrod.
Definition: CColor.h:1996
void setMem3(const GLubyte *a_colorRGB)
This method sets the color by copying three floats from an external array, each describing RGB compon...
Definition: CColor.h:1333
void setR(const GLfloat a_red)
This method sets the red component.
Definition: CColor.h:390
void setWhiteBeige()
This method sets the color to Beige.
Definition: CColor.h:2051
void setBlueCadet()
This method sets the color to Cadet Blue.
Definition: CColor.h:930
void setPinkLight()
This method sets the color to Light Pink.
Definition: CColor.h:679
void setMem4(const GLubyte *a_colorRGBA)
This method sets the color by copying four floats from an external array, each describing RGBA compon...
Definition: CColor.h:1352
void setRedDarkSalmon()
This method sets the color to Dark Red Salmon.
Definition: CColor.h:651
void setYellowPapayaWhip()
This method sets the color to Papaya Whip.
Definition: CColor.h:1719
void setWhiteLavenderBlush()
This method sets the color to Lavender Blush.
Definition: CColor.h:2069
GLfloat cColorBtoF(GLubyte a_value)
This function converts a color component from GLubyte type to GLfloat type.
Definition: CColor.h:110
void setBluePowder()
This method sets the color to Powder Blue.
Definition: CColor.h:1917
void setPurpleDarkViolet()
This method sets the color to Dark Violet.
Definition: CColor.h:799
void setBrownDarkGoldenrod()
This method sets the color to Dark Brown Goldenrod.
Definition: CColor.h:1018
void setBlueSky()
This method sets the color to Sky Blue.
Definition: CColor.h:1923
void setWhiteLinen()
This method sets the color to Linen.
Definition: CColor.h:2066
void setGrayLevel(const GLfloat a_level)
Definition: CColor.h:1141
void setBlueCornflower()
This method sets the color to Cornflower Blue.
Definition: CColor.h:1935
void setBlueLightCyan()
This method sets the color to Light Cyan.
Definition: CColor.h:1890
void setBrownPeru()
This method sets the color to Peru.
Definition: CColor.h:1021
void setPurpleOrchid()
This method sets the color to Orchid.
Definition: CColor.h:778
void setGrayDarkSlate()
This method sets the color to Dark Slate Gray.
Definition: CColor.h:2106
void setGrayGainsboro()
This method sets the color to Gainsboro.
Definition: CColor.h:2082
void setBrownWheat()
This method sets the color to Wheat.
Definition: CColor.h:1978
void setBlueLightSky()
This method sets the color to Light Sky Blue.
Definition: CColor.h:948
This class defines a color using a GLfloat representation for each component.
Definition: CColor.h:138
void setRedCrimson()
This method sets the color to Red Crimson.
Definition: CColor.h:1635
void setWhiteSnow()
This method sets the color to White Snow.
Definition: CColor.h:2027
void setBlueDark()
This method sets the color to Dark Blue.
Definition: CColor.h:972
void setRed()
This method sets the color to Red.
Definition: CColor.h:660
void setBlueLightSteel()
This method sets the color to Light Steel Blue.
Definition: CColor.h:936
GLfloat operator[](const unsigned int n) const
This operator returns the n-th component of this color (we provide both const and non-const versions ...
Definition: CColor.h:575
void setBlueTurquoise()
This method sets the color to Turquoise.
Definition: CColor.h:1899
void setPink()
This method sets the color to Pink.
Definition: CColor.h:1654
void setOrangeTomato()
This method sets the color to Orange Tomato.
Definition: CColor.h:1685
cColorf()
Default constructor of cColorf (color defaults to opaque white).
Definition: CColor.h:152
void setRedDark()
This method sets the color to Dark Red.
Definition: CColor.h:666
void setBrownPeru()
This method sets the color to Peru.
Definition: CColor.h:1999
void setBrownNavajoWhite()
This method sets the color to Navajo White.
Definition: CColor.h:997
const GLfloat * getData() const
This method returns a pointer to the color data.
Definition: CColor.h:548
void setb(const GLubyte a_red, const GLubyte a_green, const GLubyte a_blue)
This method sets the color by passing its RGB components as GLubyte parameters.
Definition: CColor.h:315
void setGreenPale()
This method sets the color to Pale Green.
Definition: CColor.h:1823
bool m_flag_color
Flag to track if components have been modified.
Definition: CColor.h:2132
GLfloat m_color[4]
RGBA components in GLubyte type.
Definition: CColor.h:1151
void setBlueSteel()
This method sets the color to Steel Blue.
Definition: CColor.h:1911
void setRedSalmon()
This method sets the color to Red Salmon.
Definition: CColor.h:1626
void setPurpleLavender()
This method sets the color to Lavender.
Definition: CColor.h:766
void setWhiteLinen()
This method sets the color to Linen.
Definition: CColor.h:1088
cColorf(const GLfloat a_red, const GLfloat a_green, const GLfloat a_blue, const GLfloat a_alpha=1.0f)
Constructor of cColorf. Define a color by passing its RGBA components as arguments.
Definition: CColor.h:175
void setYellowGold()
This method sets the color to Gold.
Definition: CColor.h:726
void setPurpleFuchsia()
This method sets the color to Fuchsia.
Definition: CColor.h:1759
void setOrangeLightSalmon()
This method sets the color to Orange Light Salmon.
Definition: CColor.h:1679
GLfloat getB() const
This method returns the blue component.
Definition: CColor.h:463
GLubyte getLuminance() const
This method returns the luminance value of this color.
Definition: CColor.h:1500
void setPurpleViolet()
This method sets the color to Violet.
Definition: CColor.h:775
void setBrown()
This method sets the color to Brown.
Definition: CColor.h:2011
void setPinkPaleVioletRed()
This method sets the color to Pale Violet Red.
Definition: CColor.h:1669
void setOrangeCoral()
This method sets the color to Orange Coral.
Definition: CColor.h:1682
cColorb getColorb() const
This method returns this color, converted to cColorb format.
Definition: CColor.cpp:59
void setBlueLight()
This method sets the color to Light Blue.
Definition: CColor.h:1920
void setf(const GLfloat a_red, const GLfloat a_green, const GLfloat a_blue, const GLfloat a_alpha=1.0f)
This method sets the color by passing its RGBA components as parameters in float format.
Definition: CColor.h:1313
void setGray()
This method sets the color to Gray.
Definition: CColor.h:2094
void setBrownRosy()
This method sets the color to Rosy Brown.
Definition: CColor.h:1987
void setGreenForest()
This method sets the color to Forest Green.
Definition: CColor.h:863
void setBrownChocolate()
This method sets the color to Chocolate.
Definition: CColor.h:2002
void setPurpleMediumSlateBlue()
This method sets the color to Medium Slate Blue.
Definition: CColor.h:1798
void setGrayLightSlate()
This method sets the color to Light Slate Gray.
Definition: CColor.h:2100
void setPurpleAmethyst()
This method sets the color to Amethyst.
Definition: CColor.h:793
void setGreenYellowGreen()
This method sets the color to Yellow Green.
Definition: CColor.h:1850
void setLuminance(const GLfloat a_luminance)
This method sets the luminance value of this color.
Definition: CColor.h:506
void setBlueAquamarine()
This method sets the color to Aquamarine.
Definition: CColor.h:1896
void setGrayGainsboro()
This method sets the color to Gainsboro.
Definition: CColor.h:1104
T cClamp(const T &a_value, const T &a_low, const T &a_high)
This function clamps a value to a specified range.
Definition: CMaths.h:362
void setYellow()
This method sets the color to Yellow.
Definition: CColor.h:1707
void setWhiteGhost()
This method sets the color to Ghost White.
Definition: CColor.h:2042
void setBluePowder()
This method sets the color to Powder Blue.
Definition: CColor.h:939
void setA(const GLubyte a_alpha)
This method sets the alpha component.
Definition: CColor.h:1457
void copyTo(cColorb &a_color)
This method copies this color to another if it has been marked.
Definition: CColor.h:1269
void setGreen()
This method sets the color to Green.
Definition: CColor.h:866
void setB(const GLfloat a_blue)
This method sets the blue component.
Definition: CColor.h:448
void setBlueDarkTurquoise()
This method sets the color to Dark Turquoise.
Definition: CColor.h:927
void setPurpleIndigo()
This method sets the color to Indigo.
Definition: CColor.h:811
void setGrayLight()
This method sets the color to Light Gray.
Definition: CColor.h:2085
void setBluePaleTurquoise()
This method sets the color to Pale Turquoise.
Definition: CColor.h:915
void setRedDark()
This method sets the color to Dark Red.
Definition: CColor.h:1644
void setWhiteLavenderBlush()
This method sets the color to Lavender Blush.
Definition: CColor.h:1091
void setBlueDodger()
This method sets the color to Doger Blue.
Definition: CColor.h:1932
void setYellowDarkKhaki()
This method sets the color to Dark Khaki.
Definition: CColor.h:1734
void setOrangeDark()
This method sets the color to Dark Orange.
Definition: CColor.h:713
GLubyte getA() const
This method returns the alpha component.
Definition: CColor.h:1472
Definition: CAudioBuffer.cpp:56
void setBlueAqua()
This method sets the color to Aqua.
Definition: CColor.h:1884
void setBrownSandy()
This method sets the color to Sandy Brown.
Definition: CColor.h:1990
void setGrayLevel(const GLubyte a_level)
Definition: CColor.h:2119
void setBlueMediumSlate()
This method sets the color to Medium Slate Blue.
Definition: CColor.h:1938
void setBrownNavajoWhite()
This method sets the color to Navajo White.
Definition: CColor.h:1975
void setYellowPaleGoldenrod()
This method sets the color to Pale Goldenrod.
Definition: CColor.h:750
void setWhiteSeashell()
This method sets the color to Seashell.
Definition: CColor.h:1070
void setBrownSandy()
This method sets the color to Sandy Brown.
Definition: CColor.h:1012
void setGreenTeal()
This method sets the color to Teal.
Definition: CColor.h:1874
void setBrownGoldenrod()
This method sets the color to Brown Goldenrod.
Definition: CColor.h:1993
void setBlueDarkTurquoise()
This method sets the color to Dark Turquoise.
Definition: CColor.h:1905
void setRedFireBrick()
This method sets the color to Red Fire Brick.
Definition: CColor.h:1641
void setGreenMediumAquamarine()
This method sets the color to Medium Aquamarine.
Definition: CColor.h:884
void setBrownBlanchedAlmond()
This method sets the color to Blanched Almond.
Definition: CColor.h:1969
void setRedLightSalmon()
This method sets the color to Light Red Salmon.
Definition: CColor.h:1632
void setPurpleMediumSlateBlue()
This method sets the color to Medium Slate Blue.
Definition: CColor.h:820
void setWhiteAzure()
This method sets the color to Azure.
Definition: CColor.h:1058
void setGreenDark()
This method sets the color to Dark Green.
Definition: CColor.h:869
void setGreenDarkCyan()
This method sets the color to Dark Cyan.
Definition: CColor.h:1871
void render() const
This method renders this color in OpenGL (sets it to be the current color).
Definition: CColor.h:532
void setYellowPeachPuff()
This method sets the color to Peach Puff.
Definition: CColor.h:747
void setGraySlate()
This method sets the color to Slate Gray.
Definition: CColor.h:1125
void setGreenChartreuse()
This method sets the color to Chartreuse.
Definition: CColor.h:1811
void setMem3(const GLfloat *a_colorRGB)
This method sets the color by copying three GLfloat from an array, each describing one of the RGB com...
Definition: CColor.h:353
void setBrownGoldenrod()
This method sets the color to Brown Goldenrod.
Definition: CColor.h:1015
void setYellow()
This method sets the color to Yellow.
Definition: CColor.h:729
void setWhiteMintCream()
This method sets the color to Mint Cream.
Definition: CColor.h:1055
void setGreenLightSea()
This method sets the color to Light Sea Green.
Definition: CColor.h:890
void setBrownMaroon()
This method sets the color to Maroon.
Definition: CColor.h:1036
void setBrownSaddle()
This method sets the color to Saddle Brown.
Definition: CColor.h:2005
void setWhiteAliceBlue()
This method sets the color to Alice Blue.
Definition: CColor.h:2039
void setGreenOlive()
This method sets the color to Olive.
Definition: CColor.h:1856
void setWhiteSeashell()
This method sets the color to Seashell.
Definition: CColor.h:2048
bool m_flag_color
Flag to track if components have been modified.
Definition: CColor.h:1154
void setPinkHot()
This method sets the color to Hot Pink.
Definition: CColor.h:1660
void setBlueTurquoise()
This method sets the color to Turquoise.
Definition: CColor.h:921
void setBrownTan()
This method sets the color to Tan.
Definition: CColor.h:1006
void setLuminance(const GLubyte a_luminance)
This method sets the luminance value of this color.
Definition: CColor.h:1486
void setGreenMediumAquamarine()
This method sets the color to Medium Aquamarine.
Definition: CColor.h:1862
~cColorb()
Destructor of cColorb.
Definition: CColor.h:1240
void setBlueMedium()
This method sets the color to Medium Blue.
Definition: CColor.h:1947
void setRedIndian()
This method sets the color to Red Indian.
Definition: CColor.h:642
void setPurpleIndigo()
This method sets the color to Indigo.
Definition: CColor.h:1789
GLfloat getG() const
This method returns the green component.
Definition: CColor.h:434
void setYellowDarkKhaki()
This method sets the color to Dark Khaki.
Definition: CColor.h:756
cColorb()
Constructor of cColorb.
Definition: CColor.h:1198
void setGreenLime()
This method sets the color to Lime.
Definition: CColor.h:1817
void setYellowPapayaWhip()
This method sets the color to Papaya Whip.
Definition: CColor.h:741
void setPurpleLavender()
This method sets the color to Lavender.
Definition: CColor.h:1744
void setGreenSpring()
This method sets the color to Spring Green.
Definition: CColor.h:854
void setRedIndian()
This method sets the color to Red Indian.
Definition: CColor.h:1620
void setPinkDeep()
This method sets the color to Deep Pink.
Definition: CColor.h:1663
void setGreenOliveDrab()
This method sets the color to Olive Drab.
Definition: CColor.h:1853
const GLubyte * getData() const
This method returns a pointer to the color data.
Definition: CColor.h:1528
void setGreenMediumSpring()
This method sets the color to Medium Spring Green.
Definition: CColor.h:851
void setWhiteMistyRose()
This method sets the color to Misty Rose.
Definition: CColor.h:1094
void setGreenChartreuse()
This method sets the color to Chartreuse.
Definition: CColor.h:833
void setb(const GLubyte a_red, const GLubyte a_green, const GLubyte a_blue, const GLubyte a_alpha)
This method sets the color by passing its RGBA components as GLubyte parameters.
Definition: CColor.h:291
void setOrangeRed()
This method sets the color to Orange Red.
Definition: CColor.h:1688
void setBrown()
This method sets the color to Brown.
Definition: CColor.h:1033
void setRedCrimson()
This method sets the color to Red Crimson.
Definition: CColor.h:657
void setGreenDarkSea()
This method sets the color to Dark Sea Green.
Definition: CColor.h:887
bool operator==(const cColorb &a_color)
This operator compares two colors and returns true if the color components RGB are identical...
Definition: CColor.h:1587
void setPinkMediumVioletRed()
This method sets the color to Medium Violet Red.
Definition: CColor.h:1666
void setBrownBisque()
This method sets the color to Bisque.
Definition: CColor.h:1972
void render() const
This method renders this color in OpenGL (sets it to be the current color).
Definition: CColor.h:1512
void setPinkHot()
This method sets the color to Hot Pink.
Definition: CColor.h:682
void setPurpleDarkOrchid()
This method sets the color to Dark Orchid.
Definition: CColor.h:1780
void setPurpleThistle()
This method sets the color to Thistle.
Definition: CColor.h:1747
void setWhiteHoneydew()
This method sets the color to Honeydew.
Definition: CColor.h:1052
GLubyte & operator[](const unsigned int n)
This operator returns the n-th component of this color (we provide both const and non-const versions ...
Definition: CColor.h:1570