}
else if(
f> 1.0) {
149 for(
size_t i= 0;
i< 4; ++
i) {
210 m_Rgba[0] = (float(
r) / 255.0f);
211 m_Rgba[1] = (float(
g) / 255.0f);
212 m_Rgba[2] = (float(
b) / 255.0f);
218 unsigned char b,
unsigned char a)
220 m_Rgba[0] = (float(
r) / 255.0f);
221 m_Rgba[1] = (float(
g) / 255.0f);
222 m_Rgba[2] = (float(
b) / 255.0f);
223 m_Rgba[3] = (float(
a) / 255.0f);
248 m_Rgba[0] = (float(
r) / 255.0f);
249 m_Rgba[1] = (float(
g) / 255.0f);
250 m_Rgba[2] = (float(
b) / 255.0f);
256 unsigned char b,
unsigned char a)
258 m_Rgba[0] = (float(
r) / 255.0f);
259 m_Rgba[1] = (float(
g) / 255.0f);
260 m_Rgba[2] = (float(
b) / 255.0f);
261 m_Rgba[3] = (float(
a) / 255.0f);
304strm <<
ToString(printAlpha, uchars);
313oss << static_cast<unsigned>(
GetRedUC()) <<
" " 314<<
static_cast<unsigned>(
GetGreenUC()) <<
" " 315<<
static_cast<unsigned>(
GetBlueUC());
317oss <<
" "<<
static_cast<unsigned>(
GetAlphaUC());
321oss << setiosflags(ios::fixed) <<
GetRed() <<
" " 335oss << (printAlpha ?
"rgba(":
"rgb(")
336<<
static_cast<unsigned>(
GetRedUC()) <<
"," 337<<
static_cast<unsigned>(
GetGreenUC()) <<
"," 338<<
static_cast<unsigned>(
GetBlueUC());
340oss <<
","<< std::setprecision(2) <<
GetAlpha();
352<< std::setfill(
'0') << std::setw(2) <<
std::hex 353<<
static_cast<unsigned>(
GetRedUC())
354<< std::setfill(
'0') << std::setw(2) <<
std::hex 356<< std::setfill(
'0') << std::setw(2) <<
std::hex 357<<
static_cast<unsigned>(
GetBlueUC());
372 if( ! myColorStr.empty()) {
373 str.swap(myColorStr);
380 "String '"+ s +
"' cannot be converted to a color");
386 if((
str[0] ==
'#'||
str.length() == 6) &&
387 str.find_first_of(
" ") == string::npos) {
388 if(
str[0] ==
'#') {
392 SetRed(
static_cast<unsigned char> 394 SetGreen(
static_cast<unsigned char> 396 SetBlue(
static_cast<unsigned char> 408string::size_type sb =
str.find_first_not_of(
"([ ");
409 if(sb == string::npos) {
413string::size_type se =
str.find_last_not_of (
")] ");
414 if(se == string::npos) {
415se =
str.size() - 1;
419list<string>::const_iterator iter = toks.begin();
421 if(toks.size() >= 3) {
426 if(toks.size() > 3) {
438 "String '"+ s +
"' cannot be converted to a color");
448 _ASSERT(alpha >= 0 && alpha <= 1);
449 return(color1 * alpha + color2 * (1.0f - alpha));
4561.0f -
color.GetGreen(),
4571.0f -
color.GetRed(),
465 _ASSERT(alpha >= 0 && alpha <= 1);
466 m_Rgba[0] = (
m_Rgba[0] * (1.0f - alpha) + 1.0f * alpha);
467 m_Rgba[1] = (
m_Rgba[1] * (1.0f - alpha) + 1.0f * alpha);
468 m_Rgba[2] = (
m_Rgba[2] * (1.0f - alpha) + 1.0f * alpha);
474 _ASSERT(alpha >= 0 && alpha <= 1);
492gs_color.
Set(grey, grey, grey, gs_color.
GetAlpha());
504{
"alice blue",
"240 248 255"},
505{
"aliceblue",
"240 248 255"},
506{
"antique white",
"250 235 215"},
507{
"antiquewhite",
"250 235 215"},
508{
"antiquewhite1",
"255 239 219"},
509{
"antiquewhite2",
"238 223 204"},
510{
"antiquewhite3",
"205 192 176"},
511{
"antiquewhite4",
"139 131 120"},
512{
"aqua",
"0 255 255"},
513{
"aquamarine",
"127 255 212"},
514{
"aquamarine1",
"127 255 212"},
515{
"aquamarine2",
"118 238 198"},
516{
"aquamarine3",
"102 205 170"},
517{
"aquamarine4",
"69 139 116"},
518{
"azure",
"240 255 255"},
519{
"azure1",
"240 255 255"},
520{
"azure2",
"224 238 238"},
521{
"azure3",
"193 205 205"},
522{
"azure4",
"131 139 139"},
523{
"beige",
"245 245 220"},
524{
"bisque",
"255 228 196"},
525{
"bisque1",
"255 228 196"},
526{
"bisque2",
"238 213 183"},
527{
"bisque3",
"205 183 158"},
528{
"bisque4",
"139 125 107"},
529{
"black",
"0 0 0"},
530{
"blanched almond",
"255 235 205"},
531{
"blanchedalmond",
"255 235 205"},
532{
"blue",
"0 0 255"},
533{
"blue violet",
"138 43 226"},
534{
"blue1",
"0 0 255"},
535{
"blue2",
"0 0 238"},
536{
"blue3",
"0 0 205"},
537{
"blue4",
"0 0 139"},
538{
"blueviolet",
"138 43 226"},
539{
"brown",
"165 42 42"},
540{
"brown1",
"255 64 64"},
541{
"brown2",
"238 59 59"},
542{
"brown3",
"205 51 51"},
543{
"brown4",
"139 35 35"},
544{
"burlywood",
"222 184 135"},
545{
"burlywood1",
"255 211 155"},
546{
"burlywood2",
"238 197 145"},
547{
"burlywood3",
"205 170 125"},
548{
"burlywood4",
"139 115 85"},
549{
"cadet blue",
"95 158 160"},
550{
"cadetblue",
"95 158 160"},
551{
"cadetblue1",
"152 245 255"},
552{
"cadetblue2",
"142 229 238"},
553{
"cadetblue3",
"122 197 205"},
554{
"cadetblue4",
"83 134 139"},
555{
"chartreuse",
"127 255 0"},
556{
"chartreuse1",
"127 255 0"},
557{
"chartreuse2",
"118 238 0"},
558{
"chartreuse3",
"102 205 0"},
559{
"chartreuse4",
"69 139 0"},
560{
"chocolate",
"210 105 30"},
561{
"chocolate1",
"255 127 36"},
562{
"chocolate2",
"238 118 33"},
563{
"chocolate3",
"205 102 29"},
564{
"chocolate4",
"139 69 19"},
565{
"coral",
"255 127 80"},
566{
"coral1",
"255 114 86"},
567{
"coral2",
"238 106 80"},
568{
"coral3",
"205 91 69"},
569{
"coral4",
"139 62 47"},
570{
"cornflower blue",
"100 149 237"},
571{
"cornflowerblue",
"100 149 237"},
572{
"cornsilk",
"255 248 220"},
573{
"cornsilk1",
"255 248 220"},
574{
"cornsilk2",
"238 232 205"},
575{
"cornsilk3",
"205 200 177"},
576{
"cornsilk4",
"139 136 120"},
577{
"crimson",
"220 20 60"},
578{
"cyan",
"0 255 255"},
579{
"cyan1",
"0 255 255"},
580{
"cyan2",
"0 238 238"},
581{
"cyan3",
"0 205 205"},
582{
"cyan4",
"0 139 139"},
583{
"dark blue",
"0 0 139"},
584{
"dark cyan",
"0 139 139"},
585{
"dark goldenrod",
"184 134 11"},
586{
"dark gray",
"169 169 169"},
587{
"dark green",
"0 100 0"},
588{
"dark grey",
"169 169 169"},
589{
"dark khaki",
"189 183 107"},
590{
"dark magenta",
"139 0 139"},
591{
"dark olive green",
"85 107 47"},
592{
"dark orange",
"255 140 0"},
593{
"dark orchid",
"153 50 204"},
594{
"dark red",
"139 0 0"},
595{
"dark salmon",
"233 150 122"},
596{
"dark sea green",
"143 188 143"},
597{
"dark slate blue",
"72 61 139"},
598{
"dark slate gray",
"47 79 79"},
599{
"dark slate grey",
"47 79 79"},
600{
"dark turquoise",
"0 206 209"},
601{
"dark violet",
"148 0 211"},
602{
"darkblue",
"0 0 139"},
603{
"darkcyan",
"0 139 139"},
604{
"darkgoldenrod",
"184 134 11"},
605{
"darkgoldenrod1",
"255 185 15"},
606{
"darkgoldenrod2",
"238 173 14"},
607{
"darkgoldenrod3",
"205 149 12"},
608{
"darkgoldenrod4",
"139 101 8"},
609{
"darkgray",
"169 169 169"},
610{
"darkgreen",
"0 100 0"},
611{
"darkgrey",
"169 169 169"},
612{
"darkkhaki",
"189 183 107"},
613{
"darkmagenta",
"139 0 139"},
614{
"darkolivegreen",
"85 107 47"},
615{
"darkolivegreen1",
"202 255 112"},
616{
"darkolivegreen2",
"188 238 104"},
617{
"darkolivegreen3",
"162 205 90"},
618{
"darkolivegreen4",
"110 139 61"},
619{
"darkorange",
"255 140 0"},
620{
"darkorange1",
"255 127 0"},
621{
"darkorange2",
"238 118 0"},
622{
"darkorange3",
"205 102 0"},
623{
"darkorange4",
"139 69 0"},
624{
"darkorchid",
"153 50 204"},
625{
"darkorchid1",
"191 62 255"},
626{
"darkorchid2",
"178 58 238"},
627{
"darkorchid3",
"154 50 205"},
628{
"darkorchid4",
"104 34 139"},
629{
"darkred",
"139 0 0"},
630{
"darksalmon",
"233 150 122"},
631{
"darkseagreen",
"143 188 143"},
632{
"darkseagreen1",
"193 255 193"},
633{
"darkseagreen2",
"180 238 180"},
634{
"darkseagreen3",
"155 205 155"},
635{
"darkseagreen4",
"105 139 105"},
636{
"darkslateblue",
"72 61 139"},
637{
"darkslategray",
"47 79 79"},
638{
"darkslategray1",
"151 255 255"},
639{
"darkslategray2",
"141 238 238"},
640{
"darkslategray3",
"121 205 205"},
641{
"darkslategray4",
"82 139 139"},
642{
"darkslategrey",
"47 79 79"},
643{
"darkturquoise",
"0 206 209"},
644{
"darkviolet",
"148 0 211"},
645{
"deep pink",
"255 20 147"},
646{
"deep sky blue",
"0 191 255"},
647{
"deeppink",
"255 20 147"},
648{
"deeppink1",
"255 20 147"},
649{
"deeppink2",
"238 18 137"},
650{
"deeppink3",
"205 16 118"},
651{
"deeppink4",
"139 10 80"},
652{
"deepskyblue",
"0 191 255"},
653{
"deepskyblue1",
"0 191 255"},
654{
"deepskyblue2",
"0 178 238"},
655{
"deepskyblue3",
"0 154 205"},
656{
"deepskyblue4",
"0 104 139"},
657{
"dim gray",
"105 105 105"},
658{
"dim grey",
"105 105 105"},
659{
"dimgray",
"105 105 105"},
660{
"dimgrey",
"105 105 105"},
661{
"dodger blue",
"30 144 255"},
662{
"dodgerblue",
"30 144 255"},
663{
"dodgerblue1",
"30 144 255"},
664{
"dodgerblue2",
"28 134 238"},
665{
"dodgerblue3",
"24 116 205"},
666{
"dodgerblue4",
"16 78 139"},
667{
"firebrick",
"178 34 34"},
668{
"firebrick1",
"255 48 48"},
669{
"firebrick2",
"238 44 44"},
670{
"firebrick3",
"205 38 38"},
671{
"firebrick4",
"139 26 26"},
672{
"floral white",
"255 250 240"},
673{
"floralwhite",
"255 250 240"},
674{
"forest green",
"34 139 34"},
675{
"forestgreen",
"34 139 34"},
676{
"fuchsia",
"255 0 255"},
677{
"gainsboro",
"220 220 220"},
678{
"ghost white",
"248 248 255"},
679{
"ghostwhite",
"248 248 255"},
680{
"gold",
"255 215 0"},
681{
"gold1",
"255 215 0"},
682{
"gold2",
"238 201 0"},
683{
"gold3",
"205 173 0"},
684{
"gold4",
"139 117 0"},
685{
"goldenrod",
"218 165 32"},
686{
"goldenrod1",
"255 193 37"},
687{
"goldenrod2",
"238 180 34"},
688{
"goldenrod3",
"205 155 29"},
689{
"goldenrod4",
"139 105 20"},
690{
"gray",
"128 128 128"},
691{
"gray0",
"0 0 0"},
692{
"gray1",
"3 3 3"},
693{
"gray10",
"26 26 26"},
694{
"gray100",
"255 255 255"},
695{
"gray11",
"28 28 28"},
696{
"gray12",
"31 31 31"},
697{
"gray13",
"33 33 33"},
698{
"gray14",
"36 36 36"},
699{
"gray15",
"38 38 38"},
700{
"gray16",
"41 41 41"},
701{
"gray17",
"43 43 43"},
702{
"gray18",
"46 46 46"},
703{
"gray19",
"48 48 48"},
704{
"gray2",
"5 5 5"},
705{
"gray20",
"51 51 51"},
706{
"gray21",
"54 54 54"},
707{
"gray22",
"56 56 56"},
708{
"gray23",
"59 59 59"},
709{
"gray24",
"61 61 61"},
710{
"gray25",
"64 64 64"},
711{
"gray26",
"66 66 66"},
712{
"gray27",
"69 69 69"},
713{
"gray28",
"71 71 71"},
714{
"gray29",
"74 74 74"},
715{
"gray3",
"8 8 8"},
716{
"gray30",
"77 77 77"},
717{
"gray31",
"79 79 79"},
718{
"gray32",
"82 82 82"},
719{
"gray33",
"84 84 84"},
720{
"gray34",
"87 87 87"},
721{
"gray35",
"89 89 89"},
722{
"gray36",
"92 92 92"},
723{
"gray37",
"94 94 94"},
724{
"gray38",
"97 97 97"},
725{
"gray39",
"99 99 99"},
726{
"gray4",
"10 10 10"},
727{
"gray40",
"102 102 102"},
728{
"gray41",
"105 105 105"},
729{
"gray42",
"107 107 107"},
730{
"gray43",
"110 110 110"},
731{
"gray44",
"112 112 112"},
732{
"gray45",
"115 115 115"},
733{
"gray46",
"117 117 117"},
734{
"gray47",
"120 120 120"},
735{
"gray48",
"122 122 122"},
736{
"gray49",
"125 125 125"},
737{
"gray5",
"13 13 13"},
738{
"gray50",
"127 127 127"},
739{
"gray51",
"130 130 130"},
740{
"gray52",
"133 133 133"},
741{
"gray53",
"135 135 135"},
742{
"gray54",
"138 138 138"},
743{
"gray55",
"140 140 140"},
744{
"gray56",
"143 143 143"},
745{
"gray57",
"145 145 145"},
746{
"gray58",
"148 148 148"},
747{
"gray59",
"150 150 150"},
748{
"gray6",
"15 15 15"},
749{
"gray60",
"153 153 153"},
750{
"gray61",
"156 156 156"},
751{
"gray62",
"158 158 158"},
752{
"gray63",
"161 161 161"},
753{
"gray64",
"163 163 163"},
754{
"gray65",
"166 166 166"},
755{
"gray66",
"168 168 168"},
756{
"gray67",
"171 171 171"},
757{
"gray68",
"173 173 173"},
758{
"gray69",
"176 176 176"},
759{
"gray7",
"18 18 18"},
760{
"gray70",
"179 179 179"},
761{
"gray71",
"181 181 181"},
762{
"gray72",
"184 184 184"},
763{
"gray73",
"186 186 186"},
764{
"gray74",
"189 189 189"},
765{
"gray75",
"191 191 191"},
766{
"gray76",
"194 194 194"},
767{
"gray77",
"196 196 196"},
768{
"gray78",
"199 199 199"},
769{
"gray79",
"201 201 201"},
770{
"gray8",
"20 20 20"},
771{
"gray80",
"204 204 204"},
772{
"gray81",
"207 207 207"},
773{
"gray82",
"209 209 209"},
774{
"gray83",
"212 212 212"},
775{
"gray84",
"214 214 214"},
776{
"gray85",
"217 217 217"},
777{
"gray86",
"219 219 219"},
778{
"gray87",
"222 222 222"},
779{
"gray88",
"224 224 224"},
780{
"gray89",
"227 227 227"},
781{
"gray9",
"23 23 23"},
782{
"gray90",
"229 229 229"},
783{
"gray91",
"232 232 232"},
784{
"gray92",
"235 235 235"},
785{
"gray93",
"237 237 237"},
786{
"gray94",
"240 240 240"},
787{
"gray95",
"242 242 242"},
788{
"gray96",
"245 245 245"},
789{
"gray97",
"247 247 247"},
790{
"gray98",
"250 250 250"},
791{
"gray99",
"252 252 252"},
792{
"green",
"0 128 0"},
793{
"green yellow",
"173 255 47"},
794{
"green1",
"0 255 0"},
795{
"green2",
"0 238 0"},
796{
"green3",
"0 205 0"},
797{
"green4",
"0 139 0"},
798{
"greenyellow",
"173 255 47"},
799{
"grey",
"128 128 128"},
800{
"grey0",
"0 0 0"},
801{
"grey1",
"3 3 3"},
802{
"grey10",
"26 26 26"},
803{
"grey100",
"255 255 255"},
804{
"grey11",
"28 28 28"},
805{
"grey12",
"31 31 31"},
806{
"grey13",
"33 33 33"},
807{
"grey14",
"36 36 36"},
808{
"grey15",
"38 38 38"},
809{
"grey16",
"41 41 41"},
810{
"grey17",
"43 43 43"},
811{
"grey18",
"46 46 46"},
812{
"grey19",
"48 48 48"},
813{
"grey2",
"5 5 5"},
814{
"grey20",
"51 51 51"},
815{
"grey21",
"54 54 54"},
816{
"grey22",
"56 56 56"},
817{
"grey23",
"59 59 59"},
818{
"grey24",
"61 61 61"},
819{
"grey25",
"64 64 64"},
820{
"grey26",
"66 66 66"},
821{
"grey27",
"69 69 69"},
822{
"grey28",
"71 71 71"},
823{
"grey29",
"74 74 74"},
824{
"grey3",
"8 8 8"},
825{
"grey30",
"77 77 77"},
826{
"grey31",
"79 79 79"},
827{
"grey32",
"82 82 82"},
828{
"grey33",
"84 84 84"},
829{
"grey34",
"87 87 87"},
830{
"grey35",
"89 89 89"},
831{
"grey36",
"92 92 92"},
832{
"grey37",
"94 94 94"},
833{
"grey38",
"97 97 97"},
834{
"grey39",
"99 99 99"},
835{
"grey4",
"10 10 10"},
836{
"grey40",
"102 102 102"},
837{
"grey41",
"105 105 105"},
838{
"grey42",
"107 107 107"},
839{
"grey43",
"110 110 110"},
840{
"grey44",
"112 112 112"},
841{
"grey45",
"115 115 115"},
842{
"grey46",
"117 117 117"},
843{
"grey47",
"120 120 120"},
844{
"grey48",
"122 122 122"},
845{
"grey49",
"125 125 125"},
846{
"grey5",
"13 13 13"},
847{
"grey50",
"127 127 127"},
848{
"grey51",
"130 130 130"},
849{
"grey52",
"133 133 133"},
850{
"grey53",
"135 135 135"},
851{
"grey54",
"138 138 138"},
852{
"grey55",
"140 140 140"},
853{
"grey56",
"143 143 143"},
854{
"grey57",
"145 145 145"},
855{
"grey58",
"148 148 148"},
856{
"grey59",
"150 150 150"},
857{
"grey6",
"15 15 15"},
858{
"grey60",
"153 153 153"},
859{
"grey61",
"156 156 156"},
860{
"grey62",
"158 158 158"},
861{
"grey63",
"161 161 161"},
862{
"grey64",
"163 163 163"},
863{
"grey65",
"166 166 166"},
864{
"grey66",
"168 168 168"},
865{
"grey67",
"171 171 171"},
866{
"grey68",
"173 173 173"},
867{
"grey69",
"176 176 176"},
868{
"grey7",
"18 18 18"},
869{
"grey70",
"179 179 179"},
870{
"grey71",
"181 181 181"},
871{
"grey72",
"184 184 184"},
872{
"grey73",
"186 186 186"},
873{
"grey74",
"189 189 189"},
874{
"grey75",
"191 191 191"},
875{
"grey76",
"194 194 194"},
876{
"grey77",
"196 196 196"},
877{
"grey78",
"199 199 199"},
878{
"grey79",
"201 201 201"},
879{
"grey8",
"20 20 20"},
880{
"grey80",
"204 204 204"},
881{
"grey81",
"207 207 207"},
882{
"grey82",
"209 209 209"},
883{
"grey83",
"212 212 212"},
884{
"grey84",
"214 214 214"},
885{
"grey85",
"217 217 217"},
886{
"grey86",
"219 219 219"},
887{
"grey87",
"222 222 222"},
888{
"grey88",
"224 224 224"},
889{
"grey89",
"227 227 227"},
890{
"grey9",
"23 23 23"},
891{
"grey90",
"229 229 229"},
892{
"grey91",
"232 232 232"},
893{
"grey92",
"235 235 235"},
894{
"grey93",
"237 237 237"},
895{
"grey94",
"240 240 240"},
896{
"grey95",
"242 242 242"},
897{
"grey96",
"245 245 245"},
898{
"grey97",
"247 247 247"},
899{
"grey98",
"250 250 250"},
900{
"grey99",
"252 252 252"},
901{
"honeydew",
"240 255 240"},
902{
"honeydew1",
"240 255 240"},
903{
"honeydew2",
"224 238 224"},
904{
"honeydew3",
"193 205 193"},
905{
"honeydew4",
"131 139 131"},
906{
"hot pink",
"255 105 180"},
907{
"hotpink",
"255 105 180"},
908{
"hotpink1",
"255 110 180"},
909{
"hotpink2",
"238 106 167"},
910{
"hotpink3",
"205 96 144"},
911{
"hotpink4",
"139 58 98"},
912{
"indian red",
"205 92 92"},
913{
"indianred",
"205 92 92"},
914{
"indianred1",
"255 106 106"},
915{
"indianred2",
"238 99 99"},
916{
"indianred3",
"205 85 85"},
917{
"indianred4",
"139 58 58"},
918{
"indigo",
"75 0 130"},
919{
"ivory",
"255 255 240"},
920{
"ivory1",
"255 255 240"},
921{
"ivory2",
"238 238 224"},
922{
"ivory3",
"205 205 193"},
923{
"ivory4",
"139 139 131"},
924{
"khaki",
"240 230 140"},
925{
"khaki1",
"255 246 143"},
926{
"khaki2",
"238 230 133"},
927{
"khaki3",
"205 198 115"},
928{
"khaki4",
"139 134 78"},
929{
"lavender",
"230 230 250"},
930{
"lavender blush",
"255 240 245"},
931{
"lavenderblush",
"255 240 245"},
932{
"lavenderblush1",
"255 240 245"},
933{
"lavenderblush2",
"238 224 229"},
934{
"lavenderblush3",
"205 193 197"},
935{
"lavenderblush4",
"139 131 134"},
936{
"lawn green",
"124 252 0"},
937{
"lawngreen",
"124 252 0"},
938{
"lemon chiffon",
"255 250 205"},
939{
"lemonchiffon",
"255 250 205"},
940{
"lemonchiffon1",
"255 250 205"},
941{
"lemonchiffon2",
"238 233 191"},
942{
"lemonchiffon3",
"205 201 165"},
943{
"lemonchiffon4",
"139 137 112"},
944{
"light blue",
"173 216 230"},
945{
"light coral",
"240 128 128"},
946{
"light cyan",
"224 255 255"},
947{
"light goldenrod",
"238 221 130"},
948{
"light goldenrod yellow",
"250 250 210"},
949{
"light gray",
"211 211 211"},
950{
"light green",
"144 238 144"},
951{
"light grey",
"211 211 211"},
952{
"light pink",
"255 182 193"},
953{
"light salmon",
"255 160 122"},
954{
"light sea green",
"32 178 170"},
955{
"light sky blue",
"135 206 250"},
956{
"light slate blue",
"132 112 255"},
957{
"light slate gray",
"119 136 153"},
958{
"light slate grey",
"119 136 153"},
959{
"light steel blue",
"176 196 222"},
960{
"light yellow",
"255 255 224"},
961{
"lightblue",
"173 216 230"},
962{
"lightblue1",
"191 239 255"},
963{
"lightblue2",
"178 223 238"},
964{
"lightblue3",
"154 192 205"},
965{
"lightblue4",
"104 131 139"},
966{
"lightcoral",
"240 128 128"},
967{
"lightcyan",
"224 255 255"},
968{
"lightcyan1",
"224 255 255"},
969{
"lightcyan2",
"209 238 238"},
970{
"lightcyan3",
"180 205 205"},
971{
"lightcyan4",
"122 139 139"},
972{
"lightgoldenrod",
"238 221 130"},
973{
"lightgoldenrod1",
"255 236 139"},
974{
"lightgoldenrod2",
"238 220 130"},
975{
"lightgoldenrod3",
"205 190 112"},
976{
"lightgoldenrod4",
"139 129 76"},
977{
"lightgoldenrodyellow",
"250 250 210"},
978{
"lightgray",
"211 211 211"},
979{
"lightgreen",
"144 238 144"},
980{
"lightgrey",
"211 211 211"},
981{
"lightpink",
"255 182 193"},
982{
"lightpink1",
"255 174 185"},
983{
"lightpink2",
"238 162 173"},
984{
"lightpink3",
"205 140 149"},
985{
"lightpink4",
"139 95 101"},
986{
"lightsalmon",
"255 160 122"},
987{
"lightsalmon1",
"255 160 122"},
988{
"lightsalmon2",
"238 149 114"},
989{
"lightsalmon3",
"205 129 98"},
990{
"lightsalmon4",
"139 87 66"},
991{
"lightseagreen",
"32 178 170"},
992{
"lightskyblue",
"135 206 250"},
993{
"lightskyblue1",
"176 226 255"},
994{
"lightskyblue2",
"164 211 238"},
995{
"lightskyblue3",
"141 182 205"},
996{
"lightskyblue4",
"96 123 139"},
997{
"lightslateblue",
"132 112 255"},
998{
"lightslategray",
"119 136 153"},
999{
"lightslategrey",
"119 136 153"},
1000{
"lightsteelblue",
"176 196 222"},
1001{
"lightsteelblue1",
"202 225 255"},
1002{
"lightsteelblue2",
"188 210 238"},
1003{
"lightsteelblue3",
"162 181 205"},
1004{
"lightsteelblue4",
"110 123 139"},
1005{
"lightyellow",
"255 255 224"},
1006{
"lightyellow1",
"255 255 224"},
1007{
"lightyellow2",
"238 238 209"},
1008{
"lightyellow3",
"205 205 180"},
1009{
"lightyellow4",
"139 139 122"},
1010{
"lime",
"0 255 0"},
1011{
"lime green",
"50 205 50"},
1012{
"limegreen",
"50 205 50"},
1013{
"linen",
"250 240 230"},
1014{
"magenta",
"255 0 255"},
1015{
"magenta1",
"255 0 255"},
1016{
"magenta2",
"238 0 238"},
1017{
"magenta3",
"205 0 205"},
1018{
"magenta4",
"139 0 139"},
1019{
"maroon",
"128 0 0"},
1020{
"maroon1",
"255 52 179"},
1021{
"maroon2",
"238 48 167"},
1022{
"maroon3",
"205 41 144"},
1023{
"maroon4",
"139 28 98"},
1024{
"medium aquamarine",
"102 205 170"},
1025{
"medium blue",
"0 0 205"},
1026{
"medium orchid",
"186 85 211"},
1027{
"medium purple",
"147 112 219"},
1028{
"medium sea green",
"60 179 113"},
1029{
"medium slate blue",
"123 104 238"},
1030{
"medium spring green",
"0 250 154"},
1031{
"medium turquoise",
"72 209 204"},
1032{
"medium violet red",
"199 21 133"},
1033{
"mediumaquamarine",
"102 205 170"},
1034{
"mediumblue",
"0 0 205"},
1035{
"mediumorchid",
"186 85 211"},
1036{
"mediumorchid1",
"224 102 255"},
1037{
"mediumorchid2",
"209 95 238"},
1038{
"mediumorchid3",
"180 82 205"},
1039{
"mediumorchid4",
"122 55 139"},
1040{
"mediumpurple",
"147 112 219"},
1041{
"mediumpurple1",
"171 130 255"},
1042{
"mediumpurple2",
"159 121 238"},
1043{
"mediumpurple3",
"137 104 205"},
1044{
"mediumpurple4",
"93 71 139"},
1045{
"mediumseagreen",
"60 179 113"},
1046{
"mediumslateblue",
"123 104 238"},
1047{
"mediumspringgreen",
"0 250 154"},
1048{
"mediumturquoise",
"72 209 204"},
1049{
"mediumvioletred",
"199 21 133"},
1050{
"midnight blue",
"25 25 112"},
1051{
"midnightblue",
"25 25 112"},
1052{
"mint cream",
"245 255 250"},
1053{
"mintcream",
"245 255 250"},
1054{
"misty rose",
"255 228 225"},
1055{
"mistyrose",
"255 228 225"},
1056{
"mistyrose1",
"255 228 225"},
1057{
"mistyrose2",
"238 213 210"},
1058{
"mistyrose3",
"205 183 181"},
1059{
"mistyrose4",
"139 125 123"},
1060{
"moccasin",
"255 228 181"},
1061{
"navajo white",
"255 222 173"},
1062{
"navajowhite",
"255 222 173"},
1063{
"navajowhite1",
"255 222 173"},
1064{
"navajowhite2",
"238 207 161"},
1065{
"navajowhite3",
"205 179 139"},
1066{
"navajowhite4",
"139 121 94"},
1067{
"navy",
"0 0 128"},
1068{
"navy blue",
"0 0 128"},
1069{
"navyblue",
"0 0 128"},
1070{
"old lace",
"253 245 230"},
1071{
"oldlace",
"253 245 230"},
1072{
"olive",
"128 128 0"},
1073{
"olive drab",
"107 142 35"},
1074{
"olivedrab",
"107 142 35"},
1075{
"olivedrab1",
"192 255 62"},
1076{
"olivedrab2",
"179 238 58"},
1077{
"olivedrab3",
"154 205 50"},
1078{
"olivedrab4",
"105 139 34"},
1079{
"orange",
"255 165 0"},
1080{
"orange red",
"255 69 0"},
1081{
"orange1",
"255 165 0"},
1082{
"orange2",
"238 154 0"},
1083{
"orange3",
"205 133 0"},
1084{
"orange4",
"139 90 0"},
1085{
"orangered",
"255 69 0"},
1086{
"orangered1",
"255 69 0"},
1087{
"orangered2",
"238 64 0"},
1088{
"orangered3",
"205 55 0"},
1089{
"orangered4",
"139 37 0"},
1090{
"orchid",
"218 112 214"},
1091{
"orchid1",
"255 131 250"},
1092{
"orchid2",
"238 122 233"},
1093{
"orchid3",
"205 105 201"},
1094{
"orchid4",
"139 71 137"},
1095{
"pale goldenrod",
"238 232 170"},
1096{
"pale green",
"152 251 152"},
1097{
"pale turquoise",
"175 238 238"},
1098{
"pale violet red",
"219 112 147"},
1099{
"palegoldenrod",
"238 232 170"},
1100{
"palegreen",
"152 251 152"},
1101{
"palegreen1",
"154 255 154"},
1102{
"palegreen2",
"144 238 144"},
1103{
"palegreen3",
"124 205 124"},
1104{
"palegreen4",
"84 139 84"},
1105{
"paleturquoise",
"175 238 238"},
1106{
"paleturquoise1",
"187 255 255"},
1107{
"paleturquoise2",
"174 238 238"},
1108{
"paleturquoise3",
"150 205 205"},
1109{
"paleturquoise4",
"102 139 139"},
1110{
"palevioletred",
"219 112 147"},
1111{
"palevioletred1",
"255 130 171"},
1112{
"palevioletred2",
"238 121 159"},
1113{
"palevioletred3",
"205 104 137"},
1114{
"palevioletred4",
"139 71 93"},
1115{
"papaya whip",
"255 239 213"},
1116{
"papayawhip",
"255 239 213"},
1117{
"peach puff",
"255 218 185"},
1118{
"peachpuff",
"255 218 185"},
1119{
"peachpuff1",
"255 218 185"},
1120{
"peachpuff2",
"238 203 173"},
1121{
"peachpuff3",
"205 175 149"},
1122{
"peachpuff4",
"139 119 101"},
1123{
"peru",
"205 133 63"},
1124{
"pink",
"255 192 203"},
1125{
"pink1",
"255 181 197"},
1126{
"pink2",
"238 169 184"},
1127{
"pink3",
"205 145 158"},
1128{
"pink4",
"139 99 108"},
1129{
"plum",
"221 160 221"},
1130{
"plum1",
"255 187 255"},
1131{
"plum2",
"238 174 238"},
1132{
"plum3",
"205 150 205"},
1133{
"plum4",
"139 102 139"},
1134{
"powder blue",
"176 224 230"},
1135{
"powderblue",
"176 224 230"},
1136{
"purple",
"128 0 128"},
1137{
"purple1",
"155 48 255"},
1138{
"purple2",
"145 44 238"},
1139{
"purple3",
"125 38 205"},
1140{
"purple4",
"85 26 139"},
1141{
"rebeccapurple",
"102 51 153"},
1142{
"red",
"255 0 0"},
1143{
"red1",
"255 0 0"},
1144{
"red2",
"238 0 0"},
1145{
"red3",
"205 0 0"},
1146{
"red4",
"139 0 0"},
1147{
"rosy brown",
"188 143 143"},
1148{
"rosybrown",
"188 143 143"},
1149{
"rosybrown1",
"255 193 193"},
1150{
"rosybrown2",
"238 180 180"},
1151{
"rosybrown3",
"205 155 155"},
1152{
"rosybrown4",
"139 105 105"},
1153{
"royal blue",
"65 105 225"},
1154{
"royalblue",
"65 105 225"},
1155{
"royalblue1",
"72 118 255"},
1156{
"royalblue2",
"67 110 238"},
1157{
"royalblue3",
"58 95 205"},
1158{
"royalblue4",
"39 64 139"},
1159{
"saddle brown",
"139 69 19"},
1160{
"saddlebrown",
"139 69 19"},
1161{
"salmon",
"250 128 114"},
1162{
"salmon1",
"255 140 105"},
1163{
"salmon2",
"238 130 98"},
1164{
"salmon3",
"205 112 84"},
1165{
"salmon4",
"139 76 57"},
1166{
"sandy brown",
"244 164 96"},
1167{
"sandybrown",
"244 164 96"},
1168{
"sea green",
"46 139 87"},
1169{
"seagreen",
"46 139 87"},
1170{
"seagreen1",
"84 255 159"},
1171{
"seagreen2",
"78 238 148"},
1172{
"seagreen3",
"67 205 128"},
1173{
"seagreen4",
"46 139 87"},
1174{
"seashell",
"255 245 238"},
1175{
"seashell1",
"255 245 238"},
1176{
"seashell2",
"238 229 222"},
1177{
"seashell3",
"205 197 191"},
1178{
"seashell4",
"139 134 130"},
1179{
"sienna",
"160 82 45"},
1180{
"sienna1",
"255 130 71"},
1181{
"sienna2",
"238 121 66"},
1182{
"sienna3",
"205 104 57"},
1183{
"sienna4",
"139 71 38"},
1184{
"silver",
"192 192 192"},
1185{
"sky blue",
"135 206 235"},
1186{
"skyblue",
"135 206 235"},
1187{
"skyblue1",
"135 206 255"},
1188{
"skyblue2",
"126 192 238"},
1189{
"skyblue3",
"108 166 205"},
1190{
"skyblue4",
"74 112 139"},
1191{
"slate blue",
"106 90 205"},
1192{
"slate gray",
"112 128 144"},
1193{
"slate grey",
"112 128 144"},
1194{
"slateblue",
"106 90 205"},
1195{
"slateblue1",
"131 111 255"},
1196{
"slateblue2",
"122 103 238"},
1197{
"slateblue3",
"105 89 205"},
1198{
"slateblue4",
"71 60 139"},
1199{
"slategray",
"112 128 144"},
1200{
"slategray1",
"198 226 255"},
1201{
"slategray2",
"185 211 238"},
1202{
"slategray3",
"159 182 205"},
1203{
"slategray4",
"108 123 139"},
1204{
"slategrey",
"112 128 144"},
1205{
"snow",
"255 250 250"},
1206{
"snow1",
"255 250 250"},
1207{
"snow2",
"238 233 233"},
1208{
"snow3",
"205 201 201"},
1209{
"snow4",
"139 137 137"},
1210{
"spring green",
"0 255 127"},
1211{
"springgreen",
"0 255 127"},
1212{
"springgreen1",
"0 255 127"},
1213{
"springgreen2",
"0 238 118"},
1214{
"springgreen3",
"0 205 102"},
1215{
"springgreen4",
"0 139 69"},
1216{
"steel blue",
"70 130 180"},
1217{
"steelblue",
"70 130 180"},
1218{
"steelblue1",
"99 184 255"},
1219{
"steelblue2",
"92 172 238"},
1220{
"steelblue3",
"79 148 205"},
1221{
"steelblue4",
"54 100 139"},
1222{
"tan",
"210 180 140"},
1223{
"tan1",
"255 165 79"},
1224{
"tan2",
"238 154 73"},
1225{
"tan3",
"205 133 63"},
1226{
"tan4",
"139 90 43"},
1227{
"teal",
"0 128 128"},
1228{
"thistle",
"216 191 216"},
1229{
"thistle1",
"255 225 255"},
1230{
"thistle2",
"238 210 238"},
1231{
"thistle3",
"205 181 205"},
1232{
"thistle4",
"139 123 139"},
1233{
"tomato",
"255 99 71"},
1234{
"tomato1",
"255 99 71"},
1235{
"tomato2",
"238 92 66"},
1236{
"tomato3",
"205 79 57"},
1237{
"tomato4",
"139 54 38"},
1238{
"turquoise",
"64 224 208"},
1239{
"turquoise1",
"0 245 255"},
1240{
"turquoise2",
"0 229 238"},
1241{
"turquoise3",
"0 197 205"},
1242{
"turquoise4",
"0 134 139"},
1243{
"violet",
"238 130 238"},
1244{
"violet red",
"208 32 144"},
1245{
"violetred",
"208 32 144"},
1246{
"violetred1",
"255 62 150"},
1247{
"violetred2",
"238 58 140"},
1248{
"violetred3",
"205 50 120"},
1249{
"violetred4",
"139 34 82"},
1250{
"wheat",
"245 222 179"},
1251{
"wheat1",
"255 231 186"},
1252{
"wheat2",
"238 216 174"},
1253{
"wheat3",
"205 186 150"},
1254{
"wheat4",
"139 126 102"},
1255{
"white",
"255 255 255"},
1256{
"white smoke",
"245 245 245"},
1257{
"whitesmoke",
"245 245 245"},
1258{
"yellow",
"255 255 0"},
1259{
"yellow green",
"154 205 50"},
1260{
"yellow1",
"255 255 0"},
1261{
"yellow2",
"238 238 0"},
1262{
"yellow3",
"205 205 0"},
1263{
"yellow4",
"139 139 0"},
1264{
"yellowgreen",
"154 205 50"}
1280 if(iter == sc_ColorMap.end()) {
1283 returniter->second;
1293 float delta= max_comp - min_comp;
1295 if(max_comp != 0) {
1296s =
delta/ max_comp;
1304}
else if(rgb.
GetRed() == max_comp) {
1306}
else if(rgb.
GetGreen() == max_comp) {
1324 int i= (
int)floor(h);
1326 floatp = v * (1 - s);
1327 floatq = v * (1 - s *
f);
1328 float t= v * (1 - s * (1 -
f));
1349 static const float Yr= 0.299f;
1350 static const float Yb= 0.114f;
1365 boolclipped =
false;
1367 if(
r< 0.0)
r= 0.0, clipped =
true;
1368 if(
r> 1.0)
r= 1.0, clipped =
true;
1370 if(
g< 0.0)
g= 0.0, clipped =
true;
1371 if(
g> 1.0)
g= 1.0, clipped =
true;
1373 if(
b< 0.0)
b= 0.0, clipped =
true;
1374 if(
b> 1.0)
b= 1.0, clipped =
true;
1409 returnsqrt((rd*rd + bd*bd + gd*gd)/3.0f);
1415 floatthreshold = 0.6f;
1436 if(
fabs(Ynew - Yorig) > threshold) {
1439 if(Yorig <= 0.6f) {
1440 if(s > 0.05f) s -= 0.05f;
1442 if(v > 1.0f) v = 1.0f;
1445 if(s > 1.0f) s = 1.0f;
1447 if(v < 0.1f) v = 0.1f;
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
class CRgbaColor provides a simple abstraction for managing colors.
class CStaticArrayMap<> is an array adaptor that provides an STLish interface to statically-defined a...
TBase::const_iterator const_iterator
static const char * str(char *buf, int n)
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
static CRgbaColor RotateColor(const CRgbaColor &c, float degrees)
Rotate the hue of the color by degrees.
unsigned char GetRedUC(void) const
Get specific channels in unsigned char values.
CRgbaColor ContrastingColor(bool onlyBW=true) const
Return a color guaranteed to contrast nicely with this color.
string ToString(bool printAlpha=true, bool uchars=true) const
Return a string representation of the current color.
void Set(float r, float g, float b)
set the color from an Fl_Color
static float ColorDistance(const CRgbaColor &c1, const CRgbaColor &c2)
returns the distance in the RGB color cube between the two colors, scaled to a range [0,...
float GetBlue(void) const
float GetGreen(void) const
static CRgbaColor Invert(const CRgbaColor &color1)
returns XOR complementary color, alpha is not affected
string ToCssString(bool printAlpha=true) const
Return a CSS string representation of the current color.
unsigned char GetGreenUC(void) const
CRgbaColor & operator+=(const CRgbaColor &c1)
unsigned char GetAlphaUC(void) const
static const char * ColorStrFromName(const string &desc)
return a mapped color string from a named color
void FromString(const string &str)
Assign color values encoded in a string.
float GetAlpha(void) const
CRgbaColor GetGreyscale() const
Returns the greyscale equivalent of the current color.
bool operator<(const CRgbaColor &c1, const CRgbaColor &c2)
define a some-what arbitrary sort order based on brightness It does have the property of being equiva...
static CRgbaColor GetColor(const string &color_type)
return a color based on a string.
CRgbaColor operator*(const CRgbaColor &c1, float f)
multiply a color by a scalar
void Lighten(float scale)
static void RgbToHsv(const CRgbaColor &rgb, float &h, float &s, float &v)
convert RGB to HSV.
string ToHtmlString() const
Return an HTML string representation of the current color.
static CRgbaColor Interpolate(const CRgbaColor &color1, const CRgbaColor &color2, float alpha)
Interpolate two colors.
unsigned char GetBlueUC(void) const
CRgbaColor operator+(const CRgbaColor &c1, const CRgbaColor &c2)
add two colors
bool operator==(const CRgbaColor &c1, const CRgbaColor &c2)
global comparison operator
static void RgbToYuv(const CRgbaColor &rgb, float &y, float &u, float &v)
convert RGB to YUV.
static CRgbaColor HsvToRgb(float h, float s, float v)
CRgbaColor()
default ctor
void SetRed(float r)
Set specific channels from floating point values.
static bool YuvToRgb(float y, float u, float v, CRgbaColor &rgb)
Not all possible input values of y, u and v will make a valid RGB color.
static float Brightness(const CRgbaColor &rgb)
return the brightness or luminance of the color.
void PrintTo(CNcbiOstream &strm) const
print the color to a stream in the form "r g b"
CRgbaColor & operator*=(float f)
float GetRed(void) const
Get specific channels in floating point values.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
Split a string using specified delimiters.
static unsigned int StringToUInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to unsigned int.
static string TruncateSpaces(const string &str, ETrunc where=eTrunc_Both)
Truncate whitespace in a string.
@ fSplit_Tokenize
All delimiters are merged and trimmed, to get non-empty tokens only.
unsigned int
A callback function used to compare two keys in a database.
static void hex(unsigned char c)
const struct ncbi::grid::netcache::search::fields::SIZE size
Int4 delta(size_t dimension_, const Int4 *score_)
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
SStaticPair< const char *, const char * > TColorElem
static const TColorElem sc_ColorArray[]
DEFINE_STATIC_ARRAY_MAP(TColorMap, sc_ColorMap, sc_ColorArray)
CStaticPairArrayMap< const char *, const char *, PNocase_CStr > TColorMap
static const float Vscale
static const float Uscale
Template structure SStaticPair is simlified replacement of STL pair<> Main reason of introducing this...
int g(Seg_Gsm *spe, Seq_Mtf *psm, Thd_Gsm *tdg)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4