rgba_color.cpp
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:42k
- /*
- * ===========================================================================
- * PRODUCTION $Log: rgba_color.cpp,v $
- * PRODUCTION Revision 1000.2 2004/06/01 21:05:10 gouriano
- * PRODUCTION PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.13
- * PRODUCTION
- * ===========================================================================
- */
- /* $Id: rgba_color.cpp,v 1000.2 2004/06/01 21:05:10 gouriano Exp $
- * ===========================================================================
- *
- * PUBLIC DOMAIN NOTICE
- * National Center for Biotechnology Information
- *
- * This software/database is a "United States Government Work" under the
- * terms of the United States Copyright Act. It was written as part of
- * the author's official duties as a United States Government employee and
- * thus cannot be copyrighted. This software/database is freely available
- * to the public for use. The National Library of Medicine and the U.S.
- * Government have not placed any restriction on its use or reproduction.
- *
- * Although all reasonable efforts have been taken to ensure the accuracy
- * and reliability of the software and data, the NLM and the U.S.
- * Government do not and cannot warrant the performance or results that
- * may be obtained by using this software or data. The NLM and the U.S.
- * Government disclaim all warranties, express or implied, including
- * warranties of performance, merchantability or fitness for any particular
- * purpose.
- *
- * Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- * Authors: Mike DiCuccio, Peter Meric
- *
- * File Description:
- * CRgbaColor - colors in the RGB colorspace, including transparency
- */
- #include <ncbi_pch.hpp>
- #include <gui/utils/rgba_color.hpp>
- #include <util/static_map.hpp>
- BEGIN_NCBI_SCOPE
- // add a color to this color
- CRgbaColor& CRgbaColor::operator+=(const CRgbaColor& c1)
- {
- m_Rgba[0] += c1.m_Rgba[0];
- m_Rgba[1] += c1.m_Rgba[1];
- m_Rgba[2] += c1.m_Rgba[2];
- m_Rgba[3] += c1.m_Rgba[3];
- return *this;
- }
- CRgbaColor operator+(const CRgbaColor& c1, const CRgbaColor& c2)
- {
- return CRgbaColor(c1.GetRed() + c2.GetRed(),
- c1.GetBlue() + c2.GetBlue(),
- c1.GetGreen() + c2.GetGreen(),
- c1.GetAlpha() + c2.GetAlpha());
- }
- // multiply this color by a scalar
- CRgbaColor& CRgbaColor::operator*=(float f)
- {
- m_Rgba[0] *= f;
- m_Rgba[1] *= f;
- m_Rgba[2] *= f;
- m_Rgba[3] *= f;
- return *this;
- }
- CRgbaColor operator*(const CRgbaColor& c1, float f)
- {
- return CRgbaColor(c1.GetRed() * f,
- c1.GetBlue() * f,
- c1.GetGreen() * f,
- c1.GetAlpha() * f);
- }
- bool operator==(const CRgbaColor& c1, const CRgbaColor& c2)
- {
- return (c1.GetRed() == c2.GetRed() &&
- c1.GetGreen() == c2.GetGreen() &&
- c1.GetBlue() == c2.GetBlue() &&
- c1.GetAlpha() == c2.GetAlpha());
- }
- CRgbaColor::CRgbaColor()
- {
- m_Rgba[0] = m_Rgba[1] = m_Rgba[2] = 0.0f;
- m_Rgba[3] = 1.0f;
- }
- CRgbaColor::CRgbaColor(const string& s)
- {
- ScanFrom(s);
- }
- CRgbaColor::CRgbaColor(const float* color, size_t size)
- {
- for (size_t i = 0; i < 4; ++i) {
- m_Rgba[i] = i < size ? color[i] : (i == 3 ? 1.0f : 0.0f);
- }
- }
- CRgbaColor::CRgbaColor(float r, float g, float b)
- {
- m_Rgba[0] = r;
- m_Rgba[1] = g;
- m_Rgba[2] = b;
- m_Rgba[3] = 1.0f;
- }
- CRgbaColor::CRgbaColor(float r, float g, float b, float a)
- {
- m_Rgba[0] = r;
- m_Rgba[1] = g;
- m_Rgba[2] = b;
- m_Rgba[3] = a;
- }
- CRgbaColor::CRgbaColor(unsigned char r, unsigned char g, unsigned char b)
- {
- m_Rgba[0] = (float(r) / 255.0f);
- m_Rgba[1] = (float(g) / 255.0f);
- m_Rgba[2] = (float(b) / 255.0f);
- m_Rgba[3] = 1.0f;
- }
- CRgbaColor::CRgbaColor(unsigned char r, unsigned char g,
- unsigned char b, unsigned char a)
- {
- m_Rgba[0] = (float(r) / 255.0f);
- m_Rgba[1] = (float(g) / 255.0f);
- m_Rgba[2] = (float(b) / 255.0f);
- m_Rgba[3] = (float(a) / 255.0f);
- }
- CRgbaColor::~CRgbaColor()
- {
- }
- void CRgbaColor::Set(float r, float g, float b)
- {
- m_Rgba[0] = r;
- m_Rgba[1] = g;
- m_Rgba[2] = b;
- m_Rgba[3] = 1.0f;
- }
- void CRgbaColor::Set(float r, float g, float b, float a)
- {
- m_Rgba[0] = r;
- m_Rgba[1] = g;
- m_Rgba[2] = b;
- m_Rgba[3] = a;
- }
- void CRgbaColor::Set(unsigned char r, unsigned char g, unsigned char b)
- {
- m_Rgba[0] = (float(r) / 255.0f);
- m_Rgba[1] = (float(g) / 255.0f);
- m_Rgba[2] = (float(b) / 255.0f);
- m_Rgba[3] = 1.0f;
- }
- void CRgbaColor::Set(unsigned char r, unsigned char g,
- unsigned char b, unsigned char a)
- {
- m_Rgba[0] = (float(r) / 255.0f);
- m_Rgba[1] = (float(g) / 255.0f);
- m_Rgba[2] = (float(b) / 255.0f);
- m_Rgba[3] = (float(a) / 255.0f);
- }
- void CRgbaColor::SetRed(float r)
- {
- m_Rgba[0] = (r > 1.0f) ? 1.0f : (r < 0.0f) ? 0.0f : r;
- }
- void CRgbaColor::SetRed(unsigned char r)
- {
- m_Rgba[0] = float(r) / 255.0f;
- }
- void CRgbaColor::SetGreen(float g)
- {
- m_Rgba[1] = (g > 1.0f) ? 1.0f : (g < 0.0f) ? 0.0f : g;
- }
- void CRgbaColor::SetGreen(unsigned char g)
- {
- m_Rgba[1] = float(g) / 255.0f;
- }
- void CRgbaColor::SetBlue(float b)
- {
- m_Rgba[2] = (b > 1.0f) ? 1.0f : (b < 0.0f) ? 0.0f : b;
- }
- void CRgbaColor::SetBlue(unsigned char b)
- {
- m_Rgba[2] = float(b) / 255.0f;
- }
- void CRgbaColor::SetAlpha(float a)
- {
- m_Rgba[3] = (a > 1.0f) ? 1.0f : (a < 0.0f) ? 0.0f : a;
- }
- void CRgbaColor::SetAlpha(unsigned char a)
- {
- m_Rgba[3] = float(a) / 255.0f;
- }
- float CRgbaColor::GetRed(void) const
- {
- return m_Rgba[0];
- }
- float CRgbaColor::GetGreen(void) const
- {
- return m_Rgba[1];
- }
- float CRgbaColor::GetBlue(void) const
- {
- return m_Rgba[2];
- }
- float CRgbaColor::GetAlpha(void) const
- {
- return m_Rgba[3];
- }
- unsigned char CRgbaColor::GetRedUC(void) const
- {
- return (unsigned char) (m_Rgba[0] * 255.0f);
- }
- unsigned char CRgbaColor::GetGreenUC(void) const
- {
- return (unsigned char) (m_Rgba[1] * 255.0f);
- }
- unsigned char CRgbaColor::GetBlueUC(void) const
- {
- return (unsigned char) (m_Rgba[2] * 255.0f);
- }
- unsigned char CRgbaColor::GetAlphaUC(void) const
- {
- return (unsigned char) (m_Rgba[3] * 255.0f);
- }
- void CRgbaColor::PrintTo(CNcbiOstream& strm) const
- {
- PrintTo(strm, true);
- }
- void CRgbaColor::PrintTo(CNcbiOstream& strm, bool printAlpha) const
- {
- strm << ToString(printAlpha);
- }
- string CRgbaColor::ToString(bool printAlpha /* = true */) const
- {
- CNcbiOstrstream oss;
- oss << static_cast<unsigned>(GetRedUC()) << " "
- << static_cast<unsigned>(GetGreenUC()) << " "
- << static_cast<unsigned>(GetBlueUC());
- if (printAlpha) {
- oss << " " << static_cast<unsigned>(GetAlphaUC());
- }
- return CNcbiOstrstreamToString(oss);
- }
- void CRgbaColor::ScanFrom(const string& s)
- {
- string myStr(s);
- // look up if this is the name of a color ("blue").
- string myColorStr(ColorStrFromName(myStr));
- if ( ! myColorStr.empty()) {
- myStr = myColorStr;
- }
-
- list<string> toks;
- NStr::Split(myStr, " ", toks);
- list<string>::const_iterator iter = toks.begin();
-
- if (toks.size() >= 3) {
- try {
- SetRed( static_cast<unsigned char>(NStr::StringToUInt(*iter++)));
- SetGreen(static_cast<unsigned char>(NStr::StringToUInt(*iter++)));
- SetBlue( static_cast<unsigned char>(NStr::StringToUInt(*iter++)));
- if (toks.size() > 3) {
- SetAlpha(static_cast<unsigned char>(NStr::StringToUInt(*iter)));
- } else {
- SetAlpha(1.0f);
- }
- }
- catch (const CStringException& e) {
- NCBI_THROW2(CStringException, eConvert, "String cannot be converted to a color [" + e.GetMsg() + "]", 0);
- }
- }
- else {
- NCBI_THROW2(CStringException, eConvert, "String cannot be converted to a color", 0);
- }
- }
- const float* CRgbaColor::GetColorArray(void) const
- {
- return m_Rgba;
- }
- CRgbaColor CRgbaColor::Interpolate(const CRgbaColor& color1,
- const CRgbaColor& color2,
- float alpha)
- {
- _ASSERT(alpha >= 0 && alpha <= 1);
- return (color1 * alpha + color2 * (1.0f - alpha));
- }
- void CRgbaColor::Lighten(float alpha)
- {
- m_Rgba[0] = (m_Rgba[0] * (1.0f - alpha) + 1.0f * alpha);
- m_Rgba[1] = (m_Rgba[1] * (1.0f - alpha) + 1.0f * alpha);
- m_Rgba[2] = (m_Rgba[2] * (1.0f - alpha) + 1.0f * alpha);
- }
- void CRgbaColor::Darken(float alpha)
- {
- m_Rgba[0] = (m_Rgba[0] * (1.0f - alpha) + 0.0f * alpha);
- m_Rgba[1] = (m_Rgba[1] * (1.0f - alpha) + 0.0f * alpha);
- m_Rgba[2] = (m_Rgba[2] * (1.0f - alpha) + 0.0f * alpha);
- }
- //
- // the actual color array - put here because of its length
- //
- typedef pair<const char*, const char*> TColorElem;
- static const TColorElem sc_ColorArray[] = {
- TColorElem("alice blue", "240 248 255"),
- TColorElem("aliceblue", "240 248 255"),
- TColorElem("antique white", "250 235 215"),
- TColorElem("antiquewhite", "250 235 215"),
- TColorElem("antiquewhite1", "255 239 219"),
- TColorElem("antiquewhite2", "238 223 204"),
- TColorElem("antiquewhite3", "205 192 176"),
- TColorElem("antiquewhite4", "139 131 120"),
- TColorElem("aquamarine", "127 255 212"),
- TColorElem("aquamarine1", "127 255 212"),
- TColorElem("aquamarine2", "118 238 198"),
- TColorElem("aquamarine3", "102 205 170"),
- TColorElem("aquamarine4", "69 139 116"),
- TColorElem("azure", "240 255 255"),
- TColorElem("azure1", "240 255 255"),
- TColorElem("azure2", "224 238 238"),
- TColorElem("azure3", "193 205 205"),
- TColorElem("azure4", "131 139 139"),
- TColorElem("beige", "245 245 220"),
- TColorElem("bisque", "255 228 196"),
- TColorElem("bisque1", "255 228 196"),
- TColorElem("bisque2", "238 213 183"),
- TColorElem("bisque3", "205 183 158"),
- TColorElem("bisque4", "139 125 107"),
- TColorElem("black", "0 0 0"),
- TColorElem("blanched almond", "255 235 205"),
- TColorElem("blanchedalmond", "255 235 205"),
- TColorElem("blue", "0 0 255"),
- TColorElem("blue violet", "138 43 226"),
- TColorElem("blue1", "0 0 255"),
- TColorElem("blue2", "0 0 238"),
- TColorElem("blue3", "0 0 205"),
- TColorElem("blue4", "0 0 139"),
- TColorElem("blueviolet", "138 43 226"),
- TColorElem("brown", "165 42 42"),
- TColorElem("brown1", "255 64 64"),
- TColorElem("brown2", "238 59 59"),
- TColorElem("brown3", "205 51 51"),
- TColorElem("brown4", "139 35 35"),
- TColorElem("burlywood", "222 184 135"),
- TColorElem("burlywood1", "255 211 155"),
- TColorElem("burlywood2", "238 197 145"),
- TColorElem("burlywood3", "205 170 125"),
- TColorElem("burlywood4", "139 115 85"),
- TColorElem("cadet blue", "95 158 160"),
- TColorElem("cadetblue", "95 158 160"),
- TColorElem("cadetblue1", "152 245 255"),
- TColorElem("cadetblue2", "142 229 238"),
- TColorElem("cadetblue3", "122 197 205"),
- TColorElem("cadetblue4", "83 134 139"),
- TColorElem("chartreuse", "127 255 0"),
- TColorElem("chartreuse1", "127 255 0"),
- TColorElem("chartreuse2", "118 238 0"),
- TColorElem("chartreuse3", "102 205 0"),
- TColorElem("chartreuse4", "69 139 0"),
- TColorElem("chocolate", "210 105 30"),
- TColorElem("chocolate1", "255 127 36"),
- TColorElem("chocolate2", "238 118 33"),
- TColorElem("chocolate3", "205 102 29"),
- TColorElem("chocolate4", "139 69 19"),
- TColorElem("coral", "255 127 80"),
- TColorElem("coral1", "255 114 86"),
- TColorElem("coral2", "238 106 80"),
- TColorElem("coral3", "205 91 69"),
- TColorElem("coral4", "139 62 47"),
- TColorElem("cornflower blue", "100 149 237"),
- TColorElem("cornflowerblue", "100 149 237"),
- TColorElem("cornsilk", "255 248 220"),
- TColorElem("cornsilk1", "255 248 220"),
- TColorElem("cornsilk2", "238 232 205"),
- TColorElem("cornsilk3", "205 200 177"),
- TColorElem("cornsilk4", "139 136 120"),
- TColorElem("cyan", "0 255 255"),
- TColorElem("cyan1", "0 255 255"),
- TColorElem("cyan2", "0 238 238"),
- TColorElem("cyan3", "0 205 205"),
- TColorElem("cyan4", "0 139 139"),
- TColorElem("dark blue", "0 0 139"),
- TColorElem("dark cyan", "0 139 139"),
- TColorElem("dark goldenrod", "184 134 11"),
- TColorElem("dark gray", "169 169 169"),
- TColorElem("dark green", "0 100 0"),
- TColorElem("dark grey", "169 169 169"),
- TColorElem("dark khaki", "189 183 107"),
- TColorElem("dark magenta", "139 0 139"),
- TColorElem("dark olive green", "85 107 47"),
- TColorElem("dark orange", "255 140 0"),
- TColorElem("dark orchid", "153 50 204"),
- TColorElem("dark red", "139 0 0"),
- TColorElem("dark salmon", "233 150 122"),
- TColorElem("dark sea green", "143 188 143"),
- TColorElem("dark slate blue", "72 61 139"),
- TColorElem("dark slate gray", "47 79 79"),
- TColorElem("dark slate grey", "47 79 79"),
- TColorElem("dark turquoise", "0 206 209"),
- TColorElem("dark violet", "148 0 211"),
- TColorElem("darkblue", "0 0 139"),
- TColorElem("darkcyan", "0 139 139"),
- TColorElem("darkgoldenrod", "184 134 11"),
- TColorElem("darkgoldenrod1", "255 185 15"),
- TColorElem("darkgoldenrod2", "238 173 14"),
- TColorElem("darkgoldenrod3", "205 149 12"),
- TColorElem("darkgoldenrod4", "139 101 8"),
- TColorElem("darkgray", "169 169 169"),
- TColorElem("darkgreen", "0 100 0"),
- TColorElem("darkgrey", "169 169 169"),
- TColorElem("darkkhaki", "189 183 107"),
- TColorElem("darkmagenta", "139 0 139"),
- TColorElem("darkolivegreen", "85 107 47"),
- TColorElem("darkolivegreen1", "202 255 112"),
- TColorElem("darkolivegreen2", "188 238 104"),
- TColorElem("darkolivegreen3", "162 205 90"),
- TColorElem("darkolivegreen4", "110 139 61"),
- TColorElem("darkorange", "255 140 0"),
- TColorElem("darkorange1", "255 127 0"),
- TColorElem("darkorange2", "238 118 0"),
- TColorElem("darkorange3", "205 102 0"),
- TColorElem("darkorange4", "139 69 0"),
- TColorElem("darkorchid", "153 50 204"),
- TColorElem("darkorchid1", "191 62 255"),
- TColorElem("darkorchid2", "178 58 238"),
- TColorElem("darkorchid3", "154 50 205"),
- TColorElem("darkorchid4", "104 34 139"),
- TColorElem("darkred", "139 0 0"),
- TColorElem("darksalmon", "233 150 122"),
- TColorElem("darkseagreen", "143 188 143"),
- TColorElem("darkseagreen1", "193 255 193"),
- TColorElem("darkseagreen2", "180 238 180"),
- TColorElem("darkseagreen3", "155 205 155"),
- TColorElem("darkseagreen4", "105 139 105"),
- TColorElem("darkslateblue", "72 61 139"),
- TColorElem("darkslategray", "47 79 79"),
- TColorElem("darkslategray1", "151 255 255"),
- TColorElem("darkslategray2", "141 238 238"),
- TColorElem("darkslategray3", "121 205 205"),
- TColorElem("darkslategray4", "82 139 139"),
- TColorElem("darkslategrey", "47 79 79"),
- TColorElem("darkturquoise", "0 206 209"),
- TColorElem("darkviolet", "148 0 211"),
- TColorElem("deep pink", "255 20 147"),
- TColorElem("deep sky blue", "0 191 255"),
- TColorElem("deeppink", "255 20 147"),
- TColorElem("deeppink1", "255 20 147"),
- TColorElem("deeppink2", "238 18 137"),
- TColorElem("deeppink3", "205 16 118"),
- TColorElem("deeppink4", "139 10 80"),
- TColorElem("deepskyblue", "0 191 255"),
- TColorElem("deepskyblue1", "0 191 255"),
- TColorElem("deepskyblue2", "0 178 238"),
- TColorElem("deepskyblue3", "0 154 205"),
- TColorElem("deepskyblue4", "0 104 139"),
- TColorElem("dim gray", "105 105 105"),
- TColorElem("dim grey", "105 105 105"),
- TColorElem("dimgray", "105 105 105"),
- TColorElem("dimgrey", "105 105 105"),
- TColorElem("dodger blue", "30 144 255"),
- TColorElem("dodgerblue", "30 144 255"),
- TColorElem("dodgerblue1", "30 144 255"),
- TColorElem("dodgerblue2", "28 134 238"),
- TColorElem("dodgerblue3", "24 116 205"),
- TColorElem("dodgerblue4", "16 78 139"),
- TColorElem("firebrick", "178 34 34"),
- TColorElem("firebrick1", "255 48 48"),
- TColorElem("firebrick2", "238 44 44"),
- TColorElem("firebrick3", "205 38 38"),
- TColorElem("firebrick4", "139 26 26"),
- TColorElem("floral white", "255 250 240"),
- TColorElem("floralwhite", "255 250 240"),
- TColorElem("forest green", "34 139 34"),
- TColorElem("forestgreen", "34 139 34"),
- TColorElem("gainsboro", "220 220 220"),
- TColorElem("ghost white", "248 248 255"),
- TColorElem("ghostwhite", "248 248 255"),
- TColorElem("gold", "255 215 0"),
- TColorElem("gold1", "255 215 0"),
- TColorElem("gold2", "238 201 0"),
- TColorElem("gold3", "205 173 0"),
- TColorElem("gold4", "139 117 0"),
- TColorElem("goldenrod", "218 165 32"),
- TColorElem("goldenrod1", "255 193 37"),
- TColorElem("goldenrod2", "238 180 34"),
- TColorElem("goldenrod3", "205 155 29"),
- TColorElem("goldenrod4", "139 105 20"),
- TColorElem("gray", "190 190 190"),
- TColorElem("gray0", "0 0 0"),
- TColorElem("gray1", "3 3 3"),
- TColorElem("gray10", "26 26 26"),
- TColorElem("gray100", "255 255 255"),
- TColorElem("gray11", "28 28 28"),
- TColorElem("gray12", "31 31 31"),
- TColorElem("gray13", "33 33 33"),
- TColorElem("gray14", "36 36 36"),
- TColorElem("gray15", "38 38 38"),
- TColorElem("gray16", "41 41 41"),
- TColorElem("gray17", "43 43 43"),
- TColorElem("gray18", "46 46 46"),
- TColorElem("gray19", "48 48 48"),
- TColorElem("gray2", "5 5 5"),
- TColorElem("gray20", "51 51 51"),
- TColorElem("gray21", "54 54 54"),
- TColorElem("gray22", "56 56 56"),
- TColorElem("gray23", "59 59 59"),
- TColorElem("gray24", "61 61 61"),
- TColorElem("gray25", "64 64 64"),
- TColorElem("gray26", "66 66 66"),
- TColorElem("gray27", "69 69 69"),
- TColorElem("gray28", "71 71 71"),
- TColorElem("gray29", "74 74 74"),
- TColorElem("gray3", "8 8 8"),
- TColorElem("gray30", "77 77 77"),
- TColorElem("gray31", "79 79 79"),
- TColorElem("gray32", "82 82 82"),
- TColorElem("gray33", "84 84 84"),
- TColorElem("gray34", "87 87 87"),
- TColorElem("gray35", "89 89 89"),
- TColorElem("gray36", "92 92 92"),
- TColorElem("gray37", "94 94 94"),
- TColorElem("gray38", "97 97 97"),
- TColorElem("gray39", "99 99 99"),
- TColorElem("gray4", "10 10 10"),
- TColorElem("gray40", "102 102 102"),
- TColorElem("gray41", "105 105 105"),
- TColorElem("gray42", "107 107 107"),
- TColorElem("gray43", "110 110 110"),
- TColorElem("gray44", "112 112 112"),
- TColorElem("gray45", "115 115 115"),
- TColorElem("gray46", "117 117 117"),
- TColorElem("gray47", "120 120 120"),
- TColorElem("gray48", "122 122 122"),
- TColorElem("gray49", "125 125 125"),
- TColorElem("gray5", "13 13 13"),
- TColorElem("gray50", "127 127 127"),
- TColorElem("gray51", "130 130 130"),
- TColorElem("gray52", "133 133 133"),
- TColorElem("gray53", "135 135 135"),
- TColorElem("gray54", "138 138 138"),
- TColorElem("gray55", "140 140 140"),
- TColorElem("gray56", "143 143 143"),
- TColorElem("gray57", "145 145 145"),
- TColorElem("gray58", "148 148 148"),
- TColorElem("gray59", "150 150 150"),
- TColorElem("gray6", "15 15 15"),
- TColorElem("gray60", "153 153 153"),
- TColorElem("gray61", "156 156 156"),
- TColorElem("gray62", "158 158 158"),
- TColorElem("gray63", "161 161 161"),
- TColorElem("gray64", "163 163 163"),
- TColorElem("gray65", "166 166 166"),
- TColorElem("gray66", "168 168 168"),
- TColorElem("gray67", "171 171 171"),
- TColorElem("gray68", "173 173 173"),
- TColorElem("gray69", "176 176 176"),
- TColorElem("gray7", "18 18 18"),
- TColorElem("gray70", "179 179 179"),
- TColorElem("gray71", "181 181 181"),
- TColorElem("gray72", "184 184 184"),
- TColorElem("gray73", "186 186 186"),
- TColorElem("gray74", "189 189 189"),
- TColorElem("gray75", "191 191 191"),
- TColorElem("gray76", "194 194 194"),
- TColorElem("gray77", "196 196 196"),
- TColorElem("gray78", "199 199 199"),
- TColorElem("gray79", "201 201 201"),
- TColorElem("gray8", "20 20 20"),
- TColorElem("gray80", "204 204 204"),
- TColorElem("gray81", "207 207 207"),
- TColorElem("gray82", "209 209 209"),
- TColorElem("gray83", "212 212 212"),
- TColorElem("gray84", "214 214 214"),
- TColorElem("gray85", "217 217 217"),
- TColorElem("gray86", "219 219 219"),
- TColorElem("gray87", "222 222 222"),
- TColorElem("gray88", "224 224 224"),
- TColorElem("gray89", "227 227 227"),
- TColorElem("gray9", "23 23 23"),
- TColorElem("gray90", "229 229 229"),
- TColorElem("gray91", "232 232 232"),
- TColorElem("gray92", "235 235 235"),
- TColorElem("gray93", "237 237 237"),
- TColorElem("gray94", "240 240 240"),
- TColorElem("gray95", "242 242 242"),
- TColorElem("gray96", "245 245 245"),
- TColorElem("gray97", "247 247 247"),
- TColorElem("gray98", "250 250 250"),
- TColorElem("gray99", "252 252 252"),
- TColorElem("green", "0 255 0"),
- TColorElem("green yellow", "173 255 47"),
- TColorElem("green1", "0 255 0"),
- TColorElem("green2", "0 238 0"),
- TColorElem("green3", "0 205 0"),
- TColorElem("green4", "0 139 0"),
- TColorElem("greenyellow", "173 255 47"),
- TColorElem("grey", "190 190 190"),
- TColorElem("grey0", "0 0 0"),
- TColorElem("grey1", "3 3 3"),
- TColorElem("grey10", "26 26 26"),
- TColorElem("grey100", "255 255 255"),
- TColorElem("grey11", "28 28 28"),
- TColorElem("grey12", "31 31 31"),
- TColorElem("grey13", "33 33 33"),
- TColorElem("grey14", "36 36 36"),
- TColorElem("grey15", "38 38 38"),
- TColorElem("grey16", "41 41 41"),
- TColorElem("grey17", "43 43 43"),
- TColorElem("grey18", "46 46 46"),
- TColorElem("grey19", "48 48 48"),
- TColorElem("grey2", "5 5 5"),
- TColorElem("grey20", "51 51 51"),
- TColorElem("grey21", "54 54 54"),
- TColorElem("grey22", "56 56 56"),
- TColorElem("grey23", "59 59 59"),
- TColorElem("grey24", "61 61 61"),
- TColorElem("grey25", "64 64 64"),
- TColorElem("grey26", "66 66 66"),
- TColorElem("grey27", "69 69 69"),
- TColorElem("grey28", "71 71 71"),
- TColorElem("grey29", "74 74 74"),
- TColorElem("grey3", "8 8 8"),
- TColorElem("grey30", "77 77 77"),
- TColorElem("grey31", "79 79 79"),
- TColorElem("grey32", "82 82 82"),
- TColorElem("grey33", "84 84 84"),
- TColorElem("grey34", "87 87 87"),
- TColorElem("grey35", "89 89 89"),
- TColorElem("grey36", "92 92 92"),
- TColorElem("grey37", "94 94 94"),
- TColorElem("grey38", "97 97 97"),
- TColorElem("grey39", "99 99 99"),
- TColorElem("grey4", "10 10 10"),
- TColorElem("grey40", "102 102 102"),
- TColorElem("grey41", "105 105 105"),
- TColorElem("grey42", "107 107 107"),
- TColorElem("grey43", "110 110 110"),
- TColorElem("grey44", "112 112 112"),
- TColorElem("grey45", "115 115 115"),
- TColorElem("grey46", "117 117 117"),
- TColorElem("grey47", "120 120 120"),
- TColorElem("grey48", "122 122 122"),
- TColorElem("grey49", "125 125 125"),
- TColorElem("grey5", "13 13 13"),
- TColorElem("grey50", "127 127 127"),
- TColorElem("grey51", "130 130 130"),
- TColorElem("grey52", "133 133 133"),
- TColorElem("grey53", "135 135 135"),
- TColorElem("grey54", "138 138 138"),
- TColorElem("grey55", "140 140 140"),
- TColorElem("grey56", "143 143 143"),
- TColorElem("grey57", "145 145 145"),
- TColorElem("grey58", "148 148 148"),
- TColorElem("grey59", "150 150 150"),
- TColorElem("grey6", "15 15 15"),
- TColorElem("grey60", "153 153 153"),
- TColorElem("grey61", "156 156 156"),
- TColorElem("grey62", "158 158 158"),
- TColorElem("grey63", "161 161 161"),
- TColorElem("grey64", "163 163 163"),
- TColorElem("grey65", "166 166 166"),
- TColorElem("grey66", "168 168 168"),
- TColorElem("grey67", "171 171 171"),
- TColorElem("grey68", "173 173 173"),
- TColorElem("grey69", "176 176 176"),
- TColorElem("grey7", "18 18 18"),
- TColorElem("grey70", "179 179 179"),
- TColorElem("grey71", "181 181 181"),
- TColorElem("grey72", "184 184 184"),
- TColorElem("grey73", "186 186 186"),
- TColorElem("grey74", "189 189 189"),
- TColorElem("grey75", "191 191 191"),
- TColorElem("grey76", "194 194 194"),
- TColorElem("grey77", "196 196 196"),
- TColorElem("grey78", "199 199 199"),
- TColorElem("grey79", "201 201 201"),
- TColorElem("grey8", "20 20 20"),
- TColorElem("grey80", "204 204 204"),
- TColorElem("grey81", "207 207 207"),
- TColorElem("grey82", "209 209 209"),
- TColorElem("grey83", "212 212 212"),
- TColorElem("grey84", "214 214 214"),
- TColorElem("grey85", "217 217 217"),
- TColorElem("grey86", "219 219 219"),
- TColorElem("grey87", "222 222 222"),
- TColorElem("grey88", "224 224 224"),
- TColorElem("grey89", "227 227 227"),
- TColorElem("grey9", "23 23 23"),
- TColorElem("grey90", "229 229 229"),
- TColorElem("grey91", "232 232 232"),
- TColorElem("grey92", "235 235 235"),
- TColorElem("grey93", "237 237 237"),
- TColorElem("grey94", "240 240 240"),
- TColorElem("grey95", "242 242 242"),
- TColorElem("grey96", "245 245 245"),
- TColorElem("grey97", "247 247 247"),
- TColorElem("grey98", "250 250 250"),
- TColorElem("grey99", "252 252 252"),
- TColorElem("honeydew", "240 255 240"),
- TColorElem("honeydew1", "240 255 240"),
- TColorElem("honeydew2", "224 238 224"),
- TColorElem("honeydew3", "193 205 193"),
- TColorElem("honeydew4", "131 139 131"),
- TColorElem("hot pink", "255 105 180"),
- TColorElem("hotpink", "255 105 180"),
- TColorElem("hotpink1", "255 110 180"),
- TColorElem("hotpink2", "238 106 167"),
- TColorElem("hotpink3", "205 96 144"),
- TColorElem("hotpink4", "139 58 98"),
- TColorElem("indian red", "205 92 92"),
- TColorElem("indianred", "205 92 92"),
- TColorElem("indianred1", "255 106 106"),
- TColorElem("indianred2", "238 99 99"),
- TColorElem("indianred3", "205 85 85"),
- TColorElem("indianred4", "139 58 58"),
- TColorElem("ivory", "255 255 240"),
- TColorElem("ivory1", "255 255 240"),
- TColorElem("ivory2", "238 238 224"),
- TColorElem("ivory3", "205 205 193"),
- TColorElem("ivory4", "139 139 131"),
- TColorElem("khaki", "240 230 140"),
- TColorElem("khaki1", "255 246 143"),
- TColorElem("khaki2", "238 230 133"),
- TColorElem("khaki3", "205 198 115"),
- TColorElem("khaki4", "139 134 78"),
- TColorElem("lavender", "230 230 250"),
- TColorElem("lavender blush", "255 240 245"),
- TColorElem("lavenderblush", "255 240 245"),
- TColorElem("lavenderblush1", "255 240 245"),
- TColorElem("lavenderblush2", "238 224 229"),
- TColorElem("lavenderblush3", "205 193 197"),
- TColorElem("lavenderblush4", "139 131 134"),
- TColorElem("lawn green", "124 252 0"),
- TColorElem("lawngreen", "124 252 0"),
- TColorElem("lemon chiffon", "255 250 205"),
- TColorElem("lemonchiffon", "255 250 205"),
- TColorElem("lemonchiffon1", "255 250 205"),
- TColorElem("lemonchiffon2", "238 233 191"),
- TColorElem("lemonchiffon3", "205 201 165"),
- TColorElem("lemonchiffon4", "139 137 112"),
- TColorElem("light blue", "173 216 230"),
- TColorElem("light coral", "240 128 128"),
- TColorElem("light cyan", "224 255 255"),
- TColorElem("light goldenrod", "238 221 130"),
- TColorElem("light goldenrod yellow", "250 250 210"),
- TColorElem("light gray", "211 211 211"),
- TColorElem("light green", "144 238 144"),
- TColorElem("light grey", "211 211 211"),
- TColorElem("light pink", "255 182 193"),
- TColorElem("light salmon", "255 160 122"),
- TColorElem("light sea green", "32 178 170"),
- TColorElem("light sky blue", "135 206 250"),
- TColorElem("light slate blue", "132 112 255"),
- TColorElem("light slate gray", "119 136 153"),
- TColorElem("light slate grey", "119 136 153"),
- TColorElem("light steel blue", "176 196 222"),
- TColorElem("light yellow", "255 255 224"),
- TColorElem("lightblue", "173 216 230"),
- TColorElem("lightblue1", "191 239 255"),
- TColorElem("lightblue2", "178 223 238"),
- TColorElem("lightblue3", "154 192 205"),
- TColorElem("lightblue4", "104 131 139"),
- TColorElem("lightcoral", "240 128 128"),
- TColorElem("lightcyan", "224 255 255"),
- TColorElem("lightcyan1", "224 255 255"),
- TColorElem("lightcyan2", "209 238 238"),
- TColorElem("lightcyan3", "180 205 205"),
- TColorElem("lightcyan4", "122 139 139"),
- TColorElem("lightgoldenrod", "238 221 130"),
- TColorElem("lightgoldenrod1", "255 236 139"),
- TColorElem("lightgoldenrod2", "238 220 130"),
- TColorElem("lightgoldenrod3", "205 190 112"),
- TColorElem("lightgoldenrod4", "139 129 76"),
- TColorElem("lightgoldenrodyellow", "250 250 210"),
- TColorElem("lightgray", "211 211 211"),
- TColorElem("lightgreen", "144 238 144"),
- TColorElem("lightgrey", "211 211 211"),
- TColorElem("lightpink", "255 182 193"),
- TColorElem("lightpink1", "255 174 185"),
- TColorElem("lightpink2", "238 162 173"),
- TColorElem("lightpink3", "205 140 149"),
- TColorElem("lightpink4", "139 95 101"),
- TColorElem("lightsalmon", "255 160 122"),
- TColorElem("lightsalmon1", "255 160 122"),
- TColorElem("lightsalmon2", "238 149 114"),
- TColorElem("lightsalmon3", "205 129 98"),
- TColorElem("lightsalmon4", "139 87 66"),
- TColorElem("lightseagreen", "32 178 170"),
- TColorElem("lightskyblue", "135 206 250"),
- TColorElem("lightskyblue1", "176 226 255"),
- TColorElem("lightskyblue2", "164 211 238"),
- TColorElem("lightskyblue3", "141 182 205"),
- TColorElem("lightskyblue4", "96 123 139"),
- TColorElem("lightslateblue", "132 112 255"),
- TColorElem("lightslategray", "119 136 153"),
- TColorElem("lightslategrey", "119 136 153"),
- TColorElem("lightsteelblue", "176 196 222"),
- TColorElem("lightsteelblue1", "202 225 255"),
- TColorElem("lightsteelblue2", "188 210 238"),
- TColorElem("lightsteelblue3", "162 181 205"),
- TColorElem("lightsteelblue4", "110 123 139"),
- TColorElem("lightyellow", "255 255 224"),
- TColorElem("lightyellow1", "255 255 224"),
- TColorElem("lightyellow2", "238 238 209"),
- TColorElem("lightyellow3", "205 205 180"),
- TColorElem("lightyellow4", "139 139 122"),
- TColorElem("lime green", "50 205 50"),
- TColorElem("limegreen", "50 205 50"),
- TColorElem("linen", "250 240 230"),
- TColorElem("magenta", "255 0 255"),
- TColorElem("magenta1", "255 0 255"),
- TColorElem("magenta2", "238 0 238"),
- TColorElem("magenta3", "205 0 205"),
- TColorElem("magenta4", "139 0 139"),
- TColorElem("maroon", "176 48 96"),
- TColorElem("maroon1", "255 52 179"),
- TColorElem("maroon2", "238 48 167"),
- TColorElem("maroon3", "205 41 144"),
- TColorElem("maroon4", "139 28 98"),
- TColorElem("medium aquamarine", "102 205 170"),
- TColorElem("medium blue", "0 0 205"),
- TColorElem("medium orchid", "186 85 211"),
- TColorElem("medium purple", "147 112 219"),
- TColorElem("medium sea green", "60 179 113"),
- TColorElem("medium slate blue", "123 104 238"),
- TColorElem("medium spring green", "0 250 154"),
- TColorElem("medium turquoise", "72 209 204"),
- TColorElem("medium violet red", "199 21 133"),
- TColorElem("mediumaquamarine", "102 205 170"),
- TColorElem("mediumblue", "0 0 205"),
- TColorElem("mediumorchid", "186 85 211"),
- TColorElem("mediumorchid1", "224 102 255"),
- TColorElem("mediumorchid2", "209 95 238"),
- TColorElem("mediumorchid3", "180 82 205"),
- TColorElem("mediumorchid4", "122 55 139"),
- TColorElem("mediumpurple", "147 112 219"),
- TColorElem("mediumpurple1", "171 130 255"),
- TColorElem("mediumpurple2", "159 121 238"),
- TColorElem("mediumpurple3", "137 104 205"),
- TColorElem("mediumpurple4", "93 71 139"),
- TColorElem("mediumseagreen", "60 179 113"),
- TColorElem("mediumslateblue", "123 104 238"),
- TColorElem("mediumspringgreen", "0 250 154"),
- TColorElem("mediumturquoise", "72 209 204"),
- TColorElem("mediumvioletred", "199 21 133"),
- TColorElem("midnight blue", "25 25 112"),
- TColorElem("midnightblue", "25 25 112"),
- TColorElem("mint cream", "245 255 250"),
- TColorElem("mintcream", "245 255 250"),
- TColorElem("misty rose", "255 228 225"),
- TColorElem("mistyrose", "255 228 225"),
- TColorElem("mistyrose1", "255 228 225"),
- TColorElem("mistyrose2", "238 213 210"),
- TColorElem("mistyrose3", "205 183 181"),
- TColorElem("mistyrose4", "139 125 123"),
- TColorElem("moccasin", "255 228 181"),
- TColorElem("navajo white", "255 222 173"),
- TColorElem("navajowhite", "255 222 173"),
- TColorElem("navajowhite1", "255 222 173"),
- TColorElem("navajowhite2", "238 207 161"),
- TColorElem("navajowhite3", "205 179 139"),
- TColorElem("navajowhite4", "139 121 94"),
- TColorElem("navy", "0 0 128"),
- TColorElem("navy blue", "0 0 128"),
- TColorElem("navyblue", "0 0 128"),
- TColorElem("old lace", "253 245 230"),
- TColorElem("oldlace", "253 245 230"),
- TColorElem("olive drab", "107 142 35"),
- TColorElem("olivedrab", "107 142 35"),
- TColorElem("olivedrab1", "192 255 62"),
- TColorElem("olivedrab2", "179 238 58"),
- TColorElem("olivedrab3", "154 205 50"),
- TColorElem("olivedrab4", "105 139 34"),
- TColorElem("orange", "255 165 0"),
- TColorElem("orange red", "255 69 0"),
- TColorElem("orange1", "255 165 0"),
- TColorElem("orange2", "238 154 0"),
- TColorElem("orange3", "205 133 0"),
- TColorElem("orange4", "139 90 0"),
- TColorElem("orangered", "255 69 0"),
- TColorElem("orangered1", "255 69 0"),
- TColorElem("orangered2", "238 64 0"),
- TColorElem("orangered3", "205 55 0"),
- TColorElem("orangered4", "139 37 0"),
- TColorElem("orchid", "218 112 214"),
- TColorElem("orchid1", "255 131 250"),
- TColorElem("orchid2", "238 122 233"),
- TColorElem("orchid3", "205 105 201"),
- TColorElem("orchid4", "139 71 137"),
- TColorElem("pale goldenrod", "238 232 170"),
- TColorElem("pale green", "152 251 152"),
- TColorElem("pale turquoise", "175 238 238"),
- TColorElem("pale violet red", "219 112 147"),
- TColorElem("palegoldenrod", "238 232 170"),
- TColorElem("palegreen", "152 251 152"),
- TColorElem("palegreen1", "154 255 154"),
- TColorElem("palegreen2", "144 238 144"),
- TColorElem("palegreen3", "124 205 124"),
- TColorElem("palegreen4", "84 139 84"),
- TColorElem("paleturquoise", "175 238 238"),
- TColorElem("paleturquoise1", "187 255 255"),
- TColorElem("paleturquoise2", "174 238 238"),
- TColorElem("paleturquoise3", "150 205 205"),
- TColorElem("paleturquoise4", "102 139 139"),
- TColorElem("palevioletred", "219 112 147"),
- TColorElem("palevioletred1", "255 130 171"),
- TColorElem("palevioletred2", "238 121 159"),
- TColorElem("palevioletred3", "205 104 137"),
- TColorElem("palevioletred4", "139 71 93"),
- TColorElem("papaya whip", "255 239 213"),
- TColorElem("papayawhip", "255 239 213"),
- TColorElem("peach puff", "255 218 185"),
- TColorElem("peachpuff", "255 218 185"),
- TColorElem("peachpuff1", "255 218 185"),
- TColorElem("peachpuff2", "238 203 173"),
- TColorElem("peachpuff3", "205 175 149"),
- TColorElem("peachpuff4", "139 119 101"),
- TColorElem("peru", "205 133 63"),
- TColorElem("pink", "255 192 203"),
- TColorElem("pink1", "255 181 197"),
- TColorElem("pink2", "238 169 184"),
- TColorElem("pink3", "205 145 158"),
- TColorElem("pink4", "139 99 108"),
- TColorElem("plum", "221 160 221"),
- TColorElem("plum1", "255 187 255"),
- TColorElem("plum2", "238 174 238"),
- TColorElem("plum3", "205 150 205"),
- TColorElem("plum4", "139 102 139"),
- TColorElem("powder blue", "176 224 230"),
- TColorElem("powderblue", "176 224 230"),
- TColorElem("purple", "160 32 240"),
- TColorElem("purple1", "155 48 255"),
- TColorElem("purple2", "145 44 238"),
- TColorElem("purple3", "125 38 205"),
- TColorElem("purple4", "85 26 139"),
- TColorElem("red", "255 0 0"),
- TColorElem("red1", "255 0 0"),
- TColorElem("red2", "238 0 0"),
- TColorElem("red3", "205 0 0"),
- TColorElem("red4", "139 0 0"),
- TColorElem("rosy brown", "188 143 143"),
- TColorElem("rosybrown", "188 143 143"),
- TColorElem("rosybrown1", "255 193 193"),
- TColorElem("rosybrown2", "238 180 180"),
- TColorElem("rosybrown3", "205 155 155"),
- TColorElem("rosybrown4", "139 105 105"),
- TColorElem("royal blue", "65 105 225"),
- TColorElem("royalblue", "65 105 225"),
- TColorElem("royalblue1", "72 118 255"),
- TColorElem("royalblue2", "67 110 238"),
- TColorElem("royalblue3", "58 95 205"),
- TColorElem("royalblue4", "39 64 139"),
- TColorElem("saddle brown", "139 69 19"),
- TColorElem("saddlebrown", "139 69 19"),
- TColorElem("salmon", "250 128 114"),
- TColorElem("salmon1", "255 140 105"),
- TColorElem("salmon2", "238 130 98"),
- TColorElem("salmon3", "205 112 84"),
- TColorElem("salmon4", "139 76 57"),
- TColorElem("sandy brown", "244 164 96"),
- TColorElem("sandybrown", "244 164 96"),
- TColorElem("sea green", "46 139 87"),
- TColorElem("seagreen", "46 139 87"),
- TColorElem("seagreen1", "84 255 159"),
- TColorElem("seagreen2", "78 238 148"),
- TColorElem("seagreen3", "67 205 128"),
- TColorElem("seagreen4", "46 139 87"),
- TColorElem("seashell", "255 245 238"),
- TColorElem("seashell1", "255 245 238"),
- TColorElem("seashell2", "238 229 222"),
- TColorElem("seashell3", "205 197 191"),
- TColorElem("seashell4", "139 134 130"),
- TColorElem("sienna", "160 82 45"),
- TColorElem("sienna1", "255 130 71"),
- TColorElem("sienna2", "238 121 66"),
- TColorElem("sienna3", "205 104 57"),
- TColorElem("sienna4", "139 71 38"),
- TColorElem("sky blue", "135 206 235"),
- TColorElem("skyblue", "135 206 235"),
- TColorElem("skyblue1", "135 206 255"),
- TColorElem("skyblue2", "126 192 238"),
- TColorElem("skyblue3", "108 166 205"),
- TColorElem("skyblue4", "74 112 139"),
- TColorElem("slate blue", "106 90 205"),
- TColorElem("slate gray", "112 128 144"),
- TColorElem("slate grey", "112 128 144"),
- TColorElem("slateblue", "106 90 205"),
- TColorElem("slateblue1", "131 111 255"),
- TColorElem("slateblue2", "122 103 238"),
- TColorElem("slateblue3", "105 89 205"),
- TColorElem("slateblue4", "71 60 139"),
- TColorElem("slategray", "112 128 144"),
- TColorElem("slategray1", "198 226 255"),
- TColorElem("slategray2", "185 211 238"),
- TColorElem("slategray3", "159 182 205"),
- TColorElem("slategray4", "108 123 139"),
- TColorElem("slategrey", "112 128 144"),
- TColorElem("snow", "255 250 250"),
- TColorElem("snow1", "255 250 250"),
- TColorElem("snow2", "238 233 233"),
- TColorElem("snow3", "205 201 201"),
- TColorElem("snow4", "139 137 137"),
- TColorElem("spring green", "0 255 127"),
- TColorElem("springgreen", "0 255 127"),
- TColorElem("springgreen1", "0 255 127"),
- TColorElem("springgreen2", "0 238 118"),
- TColorElem("springgreen3", "0 205 102"),
- TColorElem("springgreen4", "0 139 69"),
- TColorElem("steel blue", "70 130 180"),
- TColorElem("steelblue", "70 130 180"),
- TColorElem("steelblue1", "99 184 255"),
- TColorElem("steelblue2", "92 172 238"),
- TColorElem("steelblue3", "79 148 205"),
- TColorElem("steelblue4", "54 100 139"),
- TColorElem("tan", "210 180 140"),
- TColorElem("tan1", "255 165 79"),
- TColorElem("tan2", "238 154 73"),
- TColorElem("tan3", "205 133 63"),
- TColorElem("tan4", "139 90 43"),
- TColorElem("thistle", "216 191 216"),
- TColorElem("thistle1", "255 225 255"),
- TColorElem("thistle2", "238 210 238"),
- TColorElem("thistle3", "205 181 205"),
- TColorElem("thistle4", "139 123 139"),
- TColorElem("tomato", "255 99 71"),
- TColorElem("tomato1", "255 99 71"),
- TColorElem("tomato2", "238 92 66"),
- TColorElem("tomato3", "205 79 57"),
- TColorElem("tomato4", "139 54 38"),
- TColorElem("turquoise", "64 224 208"),
- TColorElem("turquoise1", "0 245 255"),
- TColorElem("turquoise2", "0 229 238"),
- TColorElem("turquoise3", "0 197 205"),
- TColorElem("turquoise4", "0 134 139"),
- TColorElem("violet", "238 130 238"),
- TColorElem("violet red", "208 32 144"),
- TColorElem("violetred", "208 32 144"),
- TColorElem("violetred1", "255 62 150"),
- TColorElem("violetred2", "238 58 140"),
- TColorElem("violetred3", "205 50 120"),
- TColorElem("violetred4", "139 34 82"),
- TColorElem("wheat", "245 222 179"),
- TColorElem("wheat1", "255 231 186"),
- TColorElem("wheat2", "238 216 174"),
- TColorElem("wheat3", "205 186 150"),
- TColorElem("wheat4", "139 126 102"),
- TColorElem("white", "255 255 255"),
- TColorElem("white smoke", "245 245 245"),
- TColorElem("whitesmoke", "245 245 245"),
- TColorElem("yellow", "255 255 0"),
- TColorElem("yellow green", "154 205 50"),
- TColorElem("yellow1", "255 255 0"),
- TColorElem("yellow2", "238 238 0"),
- TColorElem("yellow3", "205 205 0"),
- TColorElem("yellow4", "139 139 0"),
- TColorElem("yellowgreen", "154 205 50")
- };
- typedef CStaticArrayMap<const char*, const char*, PNocase> TColorMap;
- static const TColorMap sc_ColorMap(sc_ColorArray, sizeof(sc_ColorArray));
- const char* CRgbaColor::ColorStrFromName(const string& desc)
- {
- TColorMap::const_iterator iter = sc_ColorMap.find(desc.c_str());
- if (iter == sc_ColorMap.end()) {
- return "";
- } else {
- return iter->second;
- }
- }
- END_NCBI_SCOPE
- /*
- * ===========================================================================
- * $Log: rgba_color.cpp,v $
- * Revision 1000.2 2004/06/01 21:05:10 gouriano
- * PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.13
- *
- * Revision 1.13 2004/05/21 22:27:51 gorelenk
- * Added PCH ncbi_pch.hpp
- *
- * Revision 1.12 2004/05/11 13:47:49 dicuccio
- * Added Darker(), Lighter()
- *
- * Revision 1.11 2004/03/22 16:43:40 rsmith
- * fix misspelling in Interpolate.
- *
- * Revision 1.10 2004/01/27 18:46:38 dicuccio
- * Moved member operators to global operators. Added Interpolate(). Added much
- * more complete handling of named colors
- *
- * Revision 1.9 2003/12/22 19:36:40 dicuccio
- * Added functions to add/scale colors
- *
- * Revision 1.8 2003/10/30 14:46:31 rsmith
- * Add grays.
- *
- * Revision 1.7 2003/10/30 13:35:08 rsmith
- * Add static method ColorStrFromName, converts "blue" to "0 0 255".
- * ScanFrom now uses ColorStrFromName to convert certain color name strings to
- * colors.
- *
- * Revision 1.6 2003/09/25 16:36:20 rsmith
- * ToString writes out integer not floating point values, ScanFrom expects the
- * same. TODO: make ScanFrom accept a wider range of input strings (floats,
- * named values "blue")
- *
- * Revision 1.5 2003/09/01 12:42:36 meric
- * Added ScanFrom(const string&), which is now used by a ctor
- *
- * Revision 1.4 2003/08/28 12:05:11 ucko
- * Got rid of sstream (not portable to older versions of GCC)
- *
- * Revision 1.3 2003/08/25 18:02:19 rsmith
- * Colors to and from strings.
- *
- * Revision 1.2 2003/06/18 18:08:26 meric
- * Fixed ommission of ~CRgaColor and GetColorArray()
- *
- * Revision 1.1 2003/06/18 17:57:50 meric
- * Moved inlined implementation from header file
- *
- *
- * ===========================================================================
- */