![]() |
00001 // ColorDefinitions.cpp: implementation of the ColorDefinitions class. 00002 // 00004 00005 #include "ColorDefinitions.h" 00006 00008 // Construction/Destruction 00010 00011 ColorDefinitions::ColorDefinitions(){ 00012 //see http://en.wikipedia.org/wiki/Web_colors 00013 names["black"]=SimpleColor(0,0,0); 00014 names["gray"]=SimpleColor(128,128,128); 00015 names["maroon"]=SimpleColor(128,0,0); 00016 names["purple"]=SimpleColor(128,0,128); 00017 names["green"]=SimpleColor(0,128,0); 00018 names["olive"]=SimpleColor(128,128,0); 00019 names["navy"]=SimpleColor(0,0,128); 00020 names["teal"]=SimpleColor(0,128,128); 00021 names["silver"]=SimpleColor(192,192,192); 00022 names["white"]=SimpleColor(255,255,255); 00023 names["red"]=SimpleColor(255,0,0); 00024 names["fuchsia"]=SimpleColor(255,0,255); 00025 names["lime"]=SimpleColor(0,255,0); 00026 names["yellow"]=SimpleColor(255,255,0); 00027 names["blue"]=SimpleColor(0,0,255); 00028 names["aqua"]=SimpleColor(0,255,255); 00029 00030 names["indianRed"]=SimpleColor(205,92,92); 00031 names["darkSalmon"]=SimpleColor(233,150,122); 00032 names["lightCoral"]=SimpleColor(240,128,128); 00033 names["salmon"]=SimpleColor(250,128,114); 00034 names["crimson"]=SimpleColor(220,20,60); 00035 names["fireBrick"]=SimpleColor(178,34,34); 00036 names["darkKhaki"]=SimpleColor(189,183,107); 00037 names["khaki"]=SimpleColor(240,230,140); 00038 names["paleGoldenRod"]=SimpleColor(238,232,170); 00039 names["lightGoldenRodYellow"]=SimpleColor(250,250,210); 00040 names["lightYellow"]=SimpleColor(0xFF, 0xFF, 0xE0); 00041 names["lemonChiffon"]=SimpleColor(0xFF, 0xFA, 0xCD); 00042 names["gold"]=SimpleColor(0xFF, 0xD7, 0); 00043 names["papayaWhip"]=SimpleColor(0xFF, 0xEF, 0xD5); 00044 names["mocassin"]=SimpleColor(0xFF, 0xE4, 0xB5); 00045 names["cadetBlue"]=SimpleColor(0x5F, 0x9E, 0xA0); 00046 names["slateGray"]=SimpleColor(0x70, 0x80, 0x90); 00047 names["lightSteelBlue"]=SimpleColor(0xB0, 0xC4, 0xDE); 00048 names["steelBlue"]=SimpleColor(0x46,0x82,0xB4); 00049 names["midnightBlue"]=SimpleColor(0x19,0x19,0x70); 00050 names["lightSalmon"]=SimpleColor(0xff,0xa0,0x7a); 00051 names["orange"]=SimpleColor(0xff,0xa5,0x00); 00052 names["oliveDrab"]=SimpleColor(0x55, 0x6B, 0x2F); 00053 names["darkGreen"]=SimpleColor(0, 0x64, 0); 00054 names["lightSeaGreen"]=SimpleColor(0x20, 0xB2, 0xAA); 00055 names["darkSlateBlue"]=SimpleColor(0x48, 0x3D, 0x8B); 00056 names["indigo"]=SimpleColor(0x4b, 0x00, 0x82); 00057 names["ghostWhite"]=SimpleColor(0xf8, 0xf8, 0xff); 00058 names["whiteSmoke"]=SimpleColor(0xf5, 0xf5, 0xf5); 00059 names["antiqueWhite"]=SimpleColor(0xfa, 0xeb, 0xd7); 00060 names["beige"]=SimpleColor(0xf5, 0xf5, 0xdc); 00061 names["linen"]=SimpleColor(0xfa, 0xf0, 0xe6); 00062 names["oldLace"]=SimpleColor(0xfd, 0xf5, 0xe6); 00063 names["floralWhite"]=SimpleColor(0xff, 0xfa, 0xf0); 00064 names["ivory"]=SimpleColor(0xff, 0xff, 0xf0); 00065 names["gainsboro"]=SimpleColor(0xdc, 0xdc, 0xdc); 00066 names["lightGray"]=SimpleColor(0xd3, 0xd3, 0xd3); 00067 names["darkGray"]=SimpleColor(0xa9, 0xa9, 0xa9); 00068 names["dimGray"]=SimpleColor(0x69, 0x69, 0x69); 00069 names["darkSlateGray"]=SimpleColor(0x2f, 0x4f, 0x4f); 00070 names["lightSlateGray"]=SimpleColor(0x77,0x88,0x99); 00071 names["cornSilk"]=SimpleColor(0xff,0xf8,0xdc); 00072 names["blanchedAlmond"]=SimpleColor(0xff,0xeb,0xcd); 00073 names["bisque"]=SimpleColor(0xff,0xe4,0xc4); 00074 names["navajoWhite"]=SimpleColor(0xff,0xde,0xad); 00075 names["wheat"]=SimpleColor(0xf5,0xde,0xb3); 00076 names["sandyBrown"]=SimpleColor(0xf4,0xa4,0x60); 00077 names["goldenRod"]=SimpleColor(0xda,0xa5,0x20); 00078 names["darkGoldenRod"]=SimpleColor(0xb8,0x86,0x0b); 00079 names["peru"]=SimpleColor(0xcd,0x85,0x3f); 00080 names["chocolate"]=SimpleColor(0xd2,0x69,0x1e); 00081 names["saddleBrown"]=SimpleColor(0x8b,0x45,0x13); 00082 names["brown"]=SimpleColor(0xa5,0x2a,0x2a); 00083 names["sienna"]=SimpleColor(0xa0,0x52,0x2d); 00084 names["darkRed"]=SimpleColor(0x8b,0x0,0x0); 00085 names["burlyWood"]=SimpleColor(0xde,0xb8,0x87); 00086 names["tan"]=SimpleColor(0xd2,0xb4,0x8c); 00087 names["rosyBrown"]=SimpleColor(0xbc,0x8f,0x8f); 00088 } 00089 00090 ColorDefinitions::~ColorDefinitions(){ 00091 00092 } 00093 00094 void ColorDefinitions::setColor(unsigned char& r, unsigned char& g, unsigned char& b, const char* name){ 00095 std::map<const char*, SimpleColor, ltstr>::iterator i; 00096 i=names.find(name); 00097 if(i!=names.end()){ 00098 r=(*i).second.r; 00099 g=(*i).second.g; 00100 b=(*i).second.b; 00101 } else { 00102 r=g=b=0; 00103 } 00104 }
![]() |
Thyrix homepage Users' guide
(C) Arxia 2004-2005