00001 /* 00002 * This file is part of the "Archon" framework. 00003 * (http://files3d.sourceforge.net) 00004 * 00005 * Copyright © 2002 by Kristian Spangsege and Brian Kristiansen. 00006 * 00007 * Permission to use, copy, modify, and distribute this software and 00008 * its documentation under the terms of the GNU General Public License is 00009 * hereby granted. No representations are made about the suitability of 00010 * this software for any purpose. It is provided "as is" without express 00011 * or implied warranty. See the GNU General Public License 00012 * (http://www.gnu.org/copyleft/gpl.html) for more details. 00013 * 00014 * The characters in this file are ISO8859-1 encoded. 00015 * 00016 * The documentation in this file is in "Doxygen" style 00017 * (http://www.doxygen.org). 00018 */ 00019 00020 #ifndef ARCHON_UTILITIES_COLOR_H 00021 #define ARCHON_UTILITIES_COLOR_H 00022 00023 #include <archon/math/vector.H> 00024 00025 namespace Archon 00026 { 00027 namespace Utilities 00028 { 00029 using namespace Math; 00030 00031 namespace Color 00032 { 00049 Vector3 convertRGBtoHSV(Vector3); 00050 00067 Vector3 convertHSVtoRGB(Vector3); 00068 00100 Vector3 interp(double x, double x1, double x2, Vector3 c1, Vector3 c2); 00101 00102 extern const Vector3 aliceblue; 00103 extern const Vector3 antiquewhite; 00104 extern const Vector3 aqua; 00105 extern const Vector3 aquamarine; 00106 extern const Vector3 azure; 00107 extern const Vector3 beige; 00108 extern const Vector3 bisque; 00109 extern const Vector3 black; 00110 extern const Vector3 blanchedalmond; 00111 extern const Vector3 blue; 00112 extern const Vector3 blueviolet; 00113 extern const Vector3 brown; 00114 extern const Vector3 burlywood; 00115 extern const Vector3 cadetblue; 00116 extern const Vector3 chartreuse; 00117 extern const Vector3 chocolate; 00118 extern const Vector3 coral; 00119 extern const Vector3 cornflowerblue; 00120 extern const Vector3 cornsilk; 00121 extern const Vector3 crimson; 00122 extern const Vector3 cyan; 00123 extern const Vector3 darkblue; 00124 extern const Vector3 darkcyan; 00125 extern const Vector3 darkgoldenrod; 00126 extern const Vector3 darkgray; 00127 extern const Vector3 darkgreen; 00128 extern const Vector3 darkkhaki; 00129 extern const Vector3 darkmagenta; 00130 extern const Vector3 darkolivegreen; 00131 extern const Vector3 darkorange; 00132 extern const Vector3 darkorchid; 00133 extern const Vector3 darkred; 00134 extern const Vector3 darksalmon; 00135 extern const Vector3 darkseagreen; 00136 extern const Vector3 darkslateblue; 00137 extern const Vector3 darkslategray; 00138 extern const Vector3 darkturquoise; 00139 extern const Vector3 darkviolet; 00140 extern const Vector3 deeppink; 00141 extern const Vector3 deepskyblue; 00142 extern const Vector3 dimgray; 00143 extern const Vector3 dodgerblue; 00144 extern const Vector3 firebrick; 00145 extern const Vector3 floralwhite; 00146 extern const Vector3 forestgreen; 00147 extern const Vector3 fuchsia; 00148 extern const Vector3 gainsboro; 00149 extern const Vector3 ghostwhite; 00150 extern const Vector3 gold; 00151 extern const Vector3 goldenrod; 00152 extern const Vector3 gray; 00153 extern const Vector3 green; 00154 extern const Vector3 greenyellow; 00155 extern const Vector3 honeydew; 00156 extern const Vector3 hotpink; 00157 extern const Vector3 indianred; 00158 extern const Vector3 indigo; 00159 extern const Vector3 ivory; 00160 extern const Vector3 khaki; 00161 extern const Vector3 lavender; 00162 extern const Vector3 lavenderblush; 00163 extern const Vector3 lawngreen; 00164 extern const Vector3 lemonchiffon; 00165 extern const Vector3 lightblue; 00166 extern const Vector3 lightcoral; 00167 extern const Vector3 lightcyan; 00168 extern const Vector3 lightgoldenrodyellow; 00169 extern const Vector3 lightgreen; 00170 extern const Vector3 lightgrey; 00171 extern const Vector3 lightpink; 00172 extern const Vector3 lightsalmon; 00173 extern const Vector3 lightseagreen; 00174 extern const Vector3 lightskyblue; 00175 extern const Vector3 lightslategray; 00176 extern const Vector3 lightsteelblue; 00177 extern const Vector3 lightyellow; 00178 extern const Vector3 lime; 00179 extern const Vector3 limegreen; 00180 extern const Vector3 linen; 00181 extern const Vector3 magenta; 00182 extern const Vector3 maroon; 00183 extern const Vector3 mediumaquamarine; 00184 extern const Vector3 mediumblue; 00185 extern const Vector3 mediumorchid; 00186 extern const Vector3 mediumpurple; 00187 extern const Vector3 mediumseagreen; 00188 extern const Vector3 mediumslateblue; 00189 extern const Vector3 mediumspringgreen; 00190 extern const Vector3 mediumturquoise; 00191 extern const Vector3 mediumvioletred; 00192 extern const Vector3 midnightblue; 00193 extern const Vector3 mintcream; 00194 extern const Vector3 mistyrose; 00195 extern const Vector3 moccasin; 00196 extern const Vector3 navajowhite; 00197 extern const Vector3 navy; 00198 extern const Vector3 oldlace; 00199 extern const Vector3 olive; 00200 extern const Vector3 olivedrab; 00201 extern const Vector3 orange; 00202 extern const Vector3 orangered; 00203 extern const Vector3 orchid; 00204 extern const Vector3 palegoldenrod; 00205 extern const Vector3 palegreen; 00206 extern const Vector3 paleturquoise; 00207 extern const Vector3 palevioletred; 00208 extern const Vector3 papayawhip; 00209 extern const Vector3 peachpuff; 00210 extern const Vector3 peru; 00211 extern const Vector3 pink; 00212 extern const Vector3 plum; 00213 extern const Vector3 powderblue; 00214 extern const Vector3 purple; 00215 extern const Vector3 red; 00216 extern const Vector3 rosybrown; 00217 extern const Vector3 royalblue; 00218 extern const Vector3 saddlebrown; 00219 extern const Vector3 salmon; 00220 extern const Vector3 sandybrown; 00221 extern const Vector3 seagreen; 00222 extern const Vector3 seashell; 00223 extern const Vector3 sienna; 00224 extern const Vector3 silver; 00225 extern const Vector3 skyblue; 00226 extern const Vector3 slateblue; 00227 extern const Vector3 slategray; 00228 extern const Vector3 snow; 00229 extern const Vector3 springgreen; 00230 extern const Vector3 steelblue; 00231 extern const Vector3 tan; 00232 extern const Vector3 teal; 00233 extern const Vector3 thistle; 00234 extern const Vector3 tomato; 00235 extern const Vector3 turquoise; 00236 extern const Vector3 violet; 00237 extern const Vector3 wheat; 00238 extern const Vector3 white; 00239 extern const Vector3 whitesmoke; 00240 extern const Vector3 yellow; 00241 extern const Vector3 yellowgreen; 00242 } 00243 00244 struct ColorRGBA: Vector4 00245 { 00246 ColorRGBA() {} 00247 ColorRGBA(Vector3 c, double a=1) { (*this)[0] = c[0]; (*this)[1] = c[1]; (*this)[2] = c[2]; (*this)[3] = a; } 00248 }; 00249 } 00250 } 00251 00252 #endif // ARCHON_UTILITIES_COLOR_H 00253