00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00052
00053 #ifndef __MO_COLORMAP_H__
00054 #define __MO_COLORMAP_H__
00055
00056 #import <string>
00057 #import <map>
00058
00059 using namespace std;
00060
00061
00066
00067 enum ColorName
00068 {
00069 indianred0,
00070 crimson,
00071 lightpink,
00072 lightpink1,
00073 lightpink2,
00074 lightpink3,
00075 lightpink4,
00076 pink,
00077 pink1,
00078 pink2,
00079 pink3,
00080 pink4,
00081 palevioletred,
00082 palevioletred1,
00083 palevioletred2,
00084 palevioletred3,
00085 palevioletred4,
00086 lavenderblush1,
00087 lavenderblush2,
00088 lavenderblush3,
00089 lavenderblush4,
00090 violetred1,
00091 violetred2,
00092 violetred3,
00093 violetred4,
00094 hotpink,
00095 hotpink1,
00096 hotpink2,
00097 hotpink3,
00098 hotpink4,
00099 raspberry,
00100 deeppink1,
00101 deeppink2,
00102 deeppink3,
00103 deeppink4,
00104 maroon1,
00105 maroon2,
00106 maroon3,
00107 maroon4,
00108 mediumvioletred,
00109 violetred,
00110 orchid,
00111 orchid1,
00112 orchid2,
00113 orchid3,
00114 orchid4,
00115 thistle,
00116 thistle1,
00117 thistle2,
00118 thistle3,
00119 thistle4,
00120 plum1,
00121 plum2,
00122 plum3,
00123 plum4,
00124 plum,
00125 violet,
00126 magenta,
00127 magenta2,
00128 magenta3,
00129 magenta4,
00130 purple,
00131 mediumorchid,
00132 mediumorchid1,
00133 mediumorchid2,
00134 mediumorchid3,
00135 mediumorchid4,
00136 darkviolet,
00137 darkorchid,
00138 darkorchid1,
00139 darkorchid2,
00140 darkorchid3,
00141 darkorchid4,
00142 indigo,
00143 blueviolet,
00144 purple1,
00145 purple2,
00146 purple3,
00147 purple4,
00148 mediumpurple,
00149 mediumpurple1,
00150 mediumpurple2,
00151 mediumpurple3,
00152 mediumpurple4,
00153 darkslateblue,
00154 lightslateblue,
00155 mediumslateblue,
00156 slateblue,
00157 slateblue1,
00158 slateblue2,
00159 slateblue3,
00160 slateblue4,
00161 ghostwhite,
00162 lavender,
00163 blue,
00164 blue2,
00165 blue3,
00166 blue4,
00167 navy,
00168 midnightblue,
00169 cobalt,
00170 royalblue,
00171 royalblue1,
00172 royalblue2,
00173 royalblue3,
00174 royalblue4,
00175 cornflowerblue,
00176 lightsteelblue,
00177 lightsteelblue1,
00178 lightsteelblue2,
00179 lightsteelblue3,
00180 lightsteelblue4,
00181 lightslategray,
00182 slategray,
00183 slategray1,
00184 slategray2,
00185 slategray3,
00186 slategray4,
00187 dodgerblue1,
00188 dodgerblue2,
00189 dodgerblue3,
00190 dodgerblue4,
00191 aliceblue,
00192 steelblue,
00193 steelblue1,
00194 steelblue2,
00195 steelblue3,
00196 steelblue4,
00197 lightskyblue,
00198 lightskyblue1,
00199 lightskyblue2,
00200 lightskyblue3,
00201 lightskyblue4,
00202 skyblue1,
00203 skyblue2,
00204 skyblue3,
00205 skyblue4,
00206 skyblue,
00207 deepskyblue1,
00208 deepskyblue2,
00209 deepskyblue3,
00210 deepskyblue4,
00211 peacock,
00212 lightblue,
00213 lightblue1,
00214 lightblue2,
00215 lightblue3,
00216 lightblue4,
00217 powderblue,
00218 cadetblue1,
00219 cadetblue2,
00220 cadetblue3,
00221 cadetblue4,
00222 turquoise1,
00223 turquoise2,
00224 turquoise3,
00225 turquoise4,
00226 cadetblue,
00227 darkturquoise,
00228 azure1,
00229 azure2,
00230 azure3,
00231 azure4,
00232 lightcyan1,
00233 lightcyan2,
00234 lightcyan3,
00235 lightcyan4,
00236 paleturquoise1,
00237 paleturquoise2,
00238 paleturquoise3,
00239 paleturquoise4,
00240 darkslategray,
00241 darkslategray1,
00242 darkslategray2,
00243 darkslategray3,
00244 darkslategray4,
00245 cyan,
00246 cyan2,
00247 cyan3,
00248 cyan4,
00249 teal,
00250 mediumturquoise,
00251 lightseagreen,
00252 manganeseblue,
00253 turquoise,
00254 coldgrey,
00255 turquoiseblue,
00256 aquamarine1,
00257 aquamarine2,
00258 aquamarine3,
00259 aquamarine4,
00260 mediumspringgreen,
00261 mintcream,
00262 springgreen,
00263 springgreen1,
00264 springgreen2,
00265 springgreen3,
00266 mediumseagreen,
00267 seagreen1,
00268 seagreen2,
00269 seagreen3,
00270 seagreen4,
00271 emeraldgreen,
00272 mint,
00273 cobaltgreen,
00274 honeydew1,
00275 honeydew2,
00276 honeydew3,
00277 honeydew4,
00278 darkseagreen,
00279 darkseagreen1,
00280 darkseagreen2,
00281 darkseagreen3,
00282 darkseagreen4,
00283 palegreen,
00284 palegreen1,
00285 palegreen2,
00286 palegreen3,
00287 palegreen4,
00288 limegreen,
00289 forestgreen,
00290 green1,
00291 green2,
00292 green3,
00293 green4,
00294 green,
00295 darkgreen,
00296 sapgreen,
00297 lawngreen,
00298 chartreuse1,
00299 chartreuse2,
00300 chartreuse3,
00301 chartreuse4,
00302 greenyellow,
00303 darkolivegreen1,
00304 darkolivegreen2,
00305 darkolivegreen3,
00306 darkolivegreen4,
00307 darkolivegreen,
00308 olivedrab,
00309 olivedrab1,
00310 olivedrab2,
00311 olivedrab3,
00312 olivedrab4,
00313 ivory1,
00314 ivory2,
00315 ivory3,
00316 ivory4,
00317 beige,
00318 lightyellow1,
00319 lightyellow2,
00320 lightyellow3,
00321 lightyellow4,
00322 lightgoldenrodyellow,
00323 yellow1,
00324 yellow2,
00325 yellow3,
00326 yellow4,
00327 warmgrey,
00328 olive,
00329 darkkhaki,
00330 khaki1,
00331 khaki2,
00332 khaki3,
00333 khaki4,
00334 khaki,
00335 palegoldenrod,
00336 lemonchiffon1,
00337 lemonchiffon2,
00338 lemonchiffon3,
00339 lemonchiffon4,
00340 lightgoldenrod1,
00341 lightgoldenrod2,
00342 lightgoldenrod3,
00343 lightgoldenrod4,
00344 banana,
00345 gold1,
00346 gold2,
00347 gold3,
00348 gold4,
00349 cornsilk1,
00350 cornsilk2,
00351 cornsilk3,
00352 cornsilk4,
00353 goldenrod,
00354 goldenrod1,
00355 goldenrod2,
00356 goldenrod3,
00357 goldenrod4,
00358 darkgoldenrod,
00359 darkgoldenrod1,
00360 darkgoldenrod2,
00361 darkgoldenrod3,
00362 darkgoldenrod4,
00363 orange1,
00364 orange2,
00365 orange3,
00366 orange4,
00367 floralwhite,
00368 oldlace,
00369 wheat,
00370 wheat1,
00371 wheat2,
00372 wheat3,
00373 wheat4,
00374 moccasin,
00375 papayawhip,
00376 blanchedalmond,
00377 navajowhite1,
00378 navajowhite2,
00379 navajowhite3,
00380 navajowhite4,
00381 eggshell,
00382 tanN,
00383 brick,
00384 cadmiumyellow,
00385 antiquewhite,
00386 antiquewhite1,
00387 antiquewhite2,
00388 antiquewhite3,
00389 antiquewhite4,
00390 burlywood,
00391 burlywood1,
00392 burlywood2,
00393 burlywood3,
00394 burlywood4,
00395 bisque1,
00396 bisque2,
00397 bisque3,
00398 bisque4,
00399 melon,
00400 carrot,
00401 darkorange,
00402 darkorange1,
00403 darkorange2,
00404 darkorange3,
00405 darkorange4,
00406 orange,
00407 tan1,
00408 tan2,
00409 tan3,
00410 tan4,
00411 linen,
00412 peachpuff1,
00413 peachpuff2,
00414 peachpuff3,
00415 peachpuff4,
00416 seashell1,
00417 seashell2,
00418 seashell3,
00419 seashell4,
00420 sandybrown,
00421 rawsienna,
00422 chocolate,
00423 chocolate1,
00424 chocolate2,
00425 chocolate3,
00426 chocolate4,
00427 ivoryblack,
00428 flesh,
00429 cadmiumorange,
00430 burntsienna,
00431 sienna,
00432 sienna1,
00433 sienna2,
00434 sienna3,
00435 sienna4,
00436 lightsalmon1,
00437 lightsalmon2,
00438 lightsalmon3,
00439 lightsalmon4,
00440 coral,
00441 orangered1,
00442 orangered2,
00443 orangered3,
00444 orangered4,
00445 sepia,
00446 darksalmon,
00447 salmon1,
00448 salmon2,
00449 salmon3,
00450 salmon4,
00451 coral1,
00452 coral2,
00453 coral3,
00454 coral4,
00455 burntumber,
00456 tomato1,
00457 tomato2,
00458 tomato3,
00459 tomato4,
00460 salmon,
00461 mistyrose1,
00462 mistyrose2,
00463 mistyrose3,
00464 mistyrose4,
00465 snow1,
00466 snow2,
00467 snow3,
00468 snow4,
00469 rosybrown,
00470 rosybrown1,
00471 rosybrown2,
00472 rosybrown3,
00473 rosybrown4,
00474 lightcoral,
00475 indianred,
00476 indianred1,
00477 indianred2,
00478 indianred4,
00479 indianred3,
00480 brown,
00481 brown1,
00482 brown2,
00483 brown3,
00484 brown4,
00485 firebrick,
00486 firebrick1,
00487 firebrick2,
00488 firebrick3,
00489 firebrick4,
00490 red1,
00491 red2,
00492 red3,
00493 red4,
00494 maroon,
00495 sgibeet,
00496 sgislateblue,
00497 sgilightblue,
00498 sgiteal,
00499 sgichartreuse,
00500 sgiolivedrab,
00501 sgibrightgray,
00502 sgisalmon,
00503 sgidarkgray,
00504 sgigray12,
00505 sgigray16,
00506 sgigray32,
00507 sgigray36,
00508 sgigray52,
00509 sgigray56,
00510 sgilightgray,
00511 sgigray72,
00512 sgigray76,
00513 sgigray92,
00514 sgigray96,
00515 white,
00516 whitesmoke,
00517 gainsboro,
00518 lightgrey,
00519 silver,
00520 darkgray,
00521 gray,
00522 dimgray,
00523 black,
00524 gray99,
00525 gray98,
00526 gray97,
00527 gray95,
00528 gray94,
00529 gray93,
00530 gray92,
00531 gray91,
00532 gray90,
00533 gray89,
00534 gray88,
00535 gray87,
00536 gray86,
00537 gray85,
00538 gray84,
00539 gray83,
00540 gray82,
00541 gray81,
00542 gray80,
00543 gray79,
00544 gray78,
00545 gray77,
00546 gray76,
00547 gray75,
00548 gray74,
00549 gray73,
00550 gray72,
00551 gray71,
00552 gray70,
00553 gray69,
00554 gray68,
00555 gray67,
00556 gray66,
00557 gray65,
00558 gray64,
00559 gray63,
00560 gray62,
00561 gray61,
00562 gray60,
00563 gray59,
00564 gray58,
00565 gray57,
00566 gray56,
00567 gray55,
00568 gray54,
00569 gray53,
00570 gray52,
00571 gray51,
00572 gray50,
00573 gray49,
00574 gray48,
00575 gray47,
00576 gray46,
00577 gray45,
00578 gray44,
00579 gray43,
00580 gray42,
00581 dimgay,
00582 gray40,
00583 gray39,
00584 gray38,
00585 gray37,
00586 gray36,
00587 gray35,
00588 gray34,
00589 gray33,
00590 gray32,
00591 gray31,
00592 gray30,
00593 gray29,
00594 gray28,
00595 gray27,
00596 gray26,
00597 gray25,
00598 gray24,
00599 gray23,
00600 gray22,
00601 gray21,
00602 gray20,
00603 gray19,
00604 gray18,
00605 gray17,
00606 gray16,
00607 gray15,
00608 gray14,
00609 gray13,
00610 gray12,
00611 gray11,
00612 gray10,
00613 gray9,
00614 gray8,
00615 gray7,
00616 gray6,
00617 gray5,
00618 gray4,
00619 gray3,
00620 gray2,
00621 gray1
00622 };
00623
00624
00625
00626
00636
00637 class Color
00638 {
00639 public:
00640 Color();
00641 Color( double red, double green, double blue );
00642 Color( double red, double green, double blue, double alpha );
00643
00645 void setRGBA( double red, double green, double blue, double alpha );
00646
00648 void setRGB( double red, double green, double blue );
00649
00650 public:
00651 double r, g, b, a;
00652 };
00653
00654
00659
00660 class ColorMap
00661 {
00662 public:
00664 static Color getColor(string input);
00665
00667 static void getColor(string input, float & red, float & green, float & blue );
00668
00669 private:
00671 static map <string, ColorName> m_colorMap;
00672
00674 static int isInit;
00675
00677 static int init();
00678 };
00679
00680
00681
00682 #endif