1 using System; 2 using System.Collections.Generic; 3 4 namespace Godot 5 { 6 /// <summary> 7 /// This class contains color constants created from standardized color names. 8 /// The standardized color set is based on the X11 and .NET color names. 9 /// </summary> 10 public static class Colors 11 { 12 // Color names and values are derived from core/color_names.inc 13 internal static readonly Dictionary<string, Color> namedColors = new Dictionary<string, Color> { 14 {"aliceblue", new Color(0.94f, 0.97f, 1.00f)}, 15 {"antiquewhite", new Color(0.98f, 0.92f, 0.84f)}, 16 {"aqua", new Color(0.00f, 1.00f, 1.00f)}, 17 {"aquamarine", new Color(0.50f, 1.00f, 0.83f)}, 18 {"azure", new Color(0.94f, 1.00f, 1.00f)}, 19 {"beige", new Color(0.96f, 0.96f, 0.86f)}, 20 {"bisque", new Color(1.00f, 0.89f, 0.77f)}, 21 {"black", new Color(0.00f, 0.00f, 0.00f)}, 22 {"blanchedalmond", new Color(1.00f, 0.92f, 0.80f)}, 23 {"blue", new Color(0.00f, 0.00f, 1.00f)}, 24 {"blueviolet", new Color(0.54f, 0.17f, 0.89f)}, 25 {"brown", new Color(0.65f, 0.16f, 0.16f)}, 26 {"burlywood", new Color(0.87f, 0.72f, 0.53f)}, 27 {"cadetblue", new Color(0.37f, 0.62f, 0.63f)}, 28 {"chartreuse", new Color(0.50f, 1.00f, 0.00f)}, 29 {"chocolate", new Color(0.82f, 0.41f, 0.12f)}, 30 {"coral", new Color(1.00f, 0.50f, 0.31f)}, 31 {"cornflower", new Color(0.39f, 0.58f, 0.93f)}, 32 {"cornsilk", new Color(1.00f, 0.97f, 0.86f)}, 33 {"crimson", new Color(0.86f, 0.08f, 0.24f)}, 34 {"cyan", new Color(0.00f, 1.00f, 1.00f)}, 35 {"darkblue", new Color(0.00f, 0.00f, 0.55f)}, 36 {"darkcyan", new Color(0.00f, 0.55f, 0.55f)}, 37 {"darkgoldenrod", new Color(0.72f, 0.53f, 0.04f)}, 38 {"darkgray", new Color(0.66f, 0.66f, 0.66f)}, 39 {"darkgreen", new Color(0.00f, 0.39f, 0.00f)}, 40 {"darkkhaki", new Color(0.74f, 0.72f, 0.42f)}, 41 {"darkmagenta", new Color(0.55f, 0.00f, 0.55f)}, 42 {"darkolivegreen", new Color(0.33f, 0.42f, 0.18f)}, 43 {"darkorange", new Color(1.00f, 0.55f, 0.00f)}, 44 {"darkorchid", new Color(0.60f, 0.20f, 0.80f)}, 45 {"darkred", new Color(0.55f, 0.00f, 0.00f)}, 46 {"darksalmon", new Color(0.91f, 0.59f, 0.48f)}, 47 {"darkseagreen", new Color(0.56f, 0.74f, 0.56f)}, 48 {"darkslateblue", new Color(0.28f, 0.24f, 0.55f)}, 49 {"darkslategray", new Color(0.18f, 0.31f, 0.31f)}, 50 {"darkturquoise", new Color(0.00f, 0.81f, 0.82f)}, 51 {"darkviolet", new Color(0.58f, 0.00f, 0.83f)}, 52 {"deeppink", new Color(1.00f, 0.08f, 0.58f)}, 53 {"deepskyblue", new Color(0.00f, 0.75f, 1.00f)}, 54 {"dimgray", new Color(0.41f, 0.41f, 0.41f)}, 55 {"dodgerblue", new Color(0.12f, 0.56f, 1.00f)}, 56 {"firebrick", new Color(0.70f, 0.13f, 0.13f)}, 57 {"floralwhite", new Color(1.00f, 0.98f, 0.94f)}, 58 {"forestgreen", new Color(0.13f, 0.55f, 0.13f)}, 59 {"fuchsia", new Color(1.00f, 0.00f, 1.00f)}, 60 {"gainsboro", new Color(0.86f, 0.86f, 0.86f)}, 61 {"ghostwhite", new Color(0.97f, 0.97f, 1.00f)}, 62 {"gold", new Color(1.00f, 0.84f, 0.00f)}, 63 {"goldenrod", new Color(0.85f, 0.65f, 0.13f)}, 64 {"gray", new Color(0.75f, 0.75f, 0.75f)}, 65 {"green", new Color(0.00f, 1.00f, 0.00f)}, 66 {"greenyellow", new Color(0.68f, 1.00f, 0.18f)}, 67 {"honeydew", new Color(0.94f, 1.00f, 0.94f)}, 68 {"hotpink", new Color(1.00f, 0.41f, 0.71f)}, 69 {"indianred", new Color(0.80f, 0.36f, 0.36f)}, 70 {"indigo", new Color(0.29f, 0.00f, 0.51f)}, 71 {"ivory", new Color(1.00f, 1.00f, 0.94f)}, 72 {"khaki", new Color(0.94f, 0.90f, 0.55f)}, 73 {"lavender", new Color(0.90f, 0.90f, 0.98f)}, 74 {"lavenderblush", new Color(1.00f, 0.94f, 0.96f)}, 75 {"lawngreen", new Color(0.49f, 0.99f, 0.00f)}, 76 {"lemonchiffon", new Color(1.00f, 0.98f, 0.80f)}, 77 {"lightblue", new Color(0.68f, 0.85f, 0.90f)}, 78 {"lightcoral", new Color(0.94f, 0.50f, 0.50f)}, 79 {"lightcyan", new Color(0.88f, 1.00f, 1.00f)}, 80 {"lightgoldenrod", new Color(0.98f, 0.98f, 0.82f)}, 81 {"lightgray", new Color(0.83f, 0.83f, 0.83f)}, 82 {"lightgreen", new Color(0.56f, 0.93f, 0.56f)}, 83 {"lightpink", new Color(1.00f, 0.71f, 0.76f)}, 84 {"lightsalmon", new Color(1.00f, 0.63f, 0.48f)}, 85 {"lightseagreen", new Color(0.13f, 0.70f, 0.67f)}, 86 {"lightskyblue", new Color(0.53f, 0.81f, 0.98f)}, 87 {"lightslategray", new Color(0.47f, 0.53f, 0.60f)}, 88 {"lightsteelblue", new Color(0.69f, 0.77f, 0.87f)}, 89 {"lightyellow", new Color(1.00f, 1.00f, 0.88f)}, 90 {"lime", new Color(0.00f, 1.00f, 0.00f)}, 91 {"limegreen", new Color(0.20f, 0.80f, 0.20f)}, 92 {"linen", new Color(0.98f, 0.94f, 0.90f)}, 93 {"magenta", new Color(1.00f, 0.00f, 1.00f)}, 94 {"maroon", new Color(0.69f, 0.19f, 0.38f)}, 95 {"mediumaquamarine", new Color(0.40f, 0.80f, 0.67f)}, 96 {"mediumblue", new Color(0.00f, 0.00f, 0.80f)}, 97 {"mediumorchid", new Color(0.73f, 0.33f, 0.83f)}, 98 {"mediumpurple", new Color(0.58f, 0.44f, 0.86f)}, 99 {"mediumseagreen", new Color(0.24f, 0.70f, 0.44f)}, 100 {"mediumslateblue", new Color(0.48f, 0.41f, 0.93f)}, 101 {"mediumspringgreen", new Color(0.00f, 0.98f, 0.60f)}, 102 {"mediumturquoise", new Color(0.28f, 0.82f, 0.80f)}, 103 {"mediumvioletred", new Color(0.78f, 0.08f, 0.52f)}, 104 {"midnightblue", new Color(0.10f, 0.10f, 0.44f)}, 105 {"mintcream", new Color(0.96f, 1.00f, 0.98f)}, 106 {"mistyrose", new Color(1.00f, 0.89f, 0.88f)}, 107 {"moccasin", new Color(1.00f, 0.89f, 0.71f)}, 108 {"navajowhite", new Color(1.00f, 0.87f, 0.68f)}, 109 {"navyblue", new Color(0.00f, 0.00f, 0.50f)}, 110 {"oldlace", new Color(0.99f, 0.96f, 0.90f)}, 111 {"olive", new Color(0.50f, 0.50f, 0.00f)}, 112 {"olivedrab", new Color(0.42f, 0.56f, 0.14f)}, 113 {"orange", new Color(1.00f, 0.65f, 0.00f)}, 114 {"orangered", new Color(1.00f, 0.27f, 0.00f)}, 115 {"orchid", new Color(0.85f, 0.44f, 0.84f)}, 116 {"palegoldenrod", new Color(0.93f, 0.91f, 0.67f)}, 117 {"palegreen", new Color(0.60f, 0.98f, 0.60f)}, 118 {"paleturquoise", new Color(0.69f, 0.93f, 0.93f)}, 119 {"palevioletred", new Color(0.86f, 0.44f, 0.58f)}, 120 {"papayawhip", new Color(1.00f, 0.94f, 0.84f)}, 121 {"peachpuff", new Color(1.00f, 0.85f, 0.73f)}, 122 {"peru", new Color(0.80f, 0.52f, 0.25f)}, 123 {"pink", new Color(1.00f, 0.75f, 0.80f)}, 124 {"plum", new Color(0.87f, 0.63f, 0.87f)}, 125 {"powderblue", new Color(0.69f, 0.88f, 0.90f)}, 126 {"purple", new Color(0.63f, 0.13f, 0.94f)}, 127 {"rebeccapurple", new Color(0.40f, 0.20f, 0.60f)}, 128 {"red", new Color(1.00f, 0.00f, 0.00f)}, 129 {"rosybrown", new Color(0.74f, 0.56f, 0.56f)}, 130 {"royalblue", new Color(0.25f, 0.41f, 0.88f)}, 131 {"saddlebrown", new Color(0.55f, 0.27f, 0.07f)}, 132 {"salmon", new Color(0.98f, 0.50f, 0.45f)}, 133 {"sandybrown", new Color(0.96f, 0.64f, 0.38f)}, 134 {"seagreen", new Color(0.18f, 0.55f, 0.34f)}, 135 {"seashell", new Color(1.00f, 0.96f, 0.93f)}, 136 {"sienna", new Color(0.63f, 0.32f, 0.18f)}, 137 {"silver", new Color(0.75f, 0.75f, 0.75f)}, 138 {"skyblue", new Color(0.53f, 0.81f, 0.92f)}, 139 {"slateblue", new Color(0.42f, 0.35f, 0.80f)}, 140 {"slategray", new Color(0.44f, 0.50f, 0.56f)}, 141 {"snow", new Color(1.00f, 0.98f, 0.98f)}, 142 {"springgreen", new Color(0.00f, 1.00f, 0.50f)}, 143 {"steelblue", new Color(0.27f, 0.51f, 0.71f)}, 144 {"tan", new Color(0.82f, 0.71f, 0.55f)}, 145 {"teal", new Color(0.00f, 0.50f, 0.50f)}, 146 {"thistle", new Color(0.85f, 0.75f, 0.85f)}, 147 {"tomato", new Color(1.00f, 0.39f, 0.28f)}, 148 {"transparent", new Color(1.00f, 1.00f, 1.00f, 0.00f)}, 149 {"turquoise", new Color(0.25f, 0.88f, 0.82f)}, 150 {"violet", new Color(0.93f, 0.51f, 0.93f)}, 151 {"webgreen", new Color(0.00f, 0.50f, 0.00f)}, 152 {"webgray", new Color(0.50f, 0.50f, 0.50f)}, 153 {"webmaroon", new Color(0.50f, 0.00f, 0.00f)}, 154 {"webpurple", new Color(0.50f, 0.00f, 0.50f)}, 155 {"wheat", new Color(0.96f, 0.87f, 0.70f)}, 156 {"white", new Color(1.00f, 1.00f, 1.00f)}, 157 {"whitesmoke", new Color(0.96f, 0.96f, 0.96f)}, 158 {"yellow", new Color(1.00f, 1.00f, 0.00f)}, 159 {"yellowgreen", new Color(0.60f, 0.80f, 0.20f)}, 160 }; 161 162 public static Color AliceBlue { get { return namedColors["aliceblue"]; } } 163 public static Color AntiqueWhite { get { return namedColors["antiquewhite"]; } } 164 public static Color Aqua { get { return namedColors["aqua"]; } } 165 public static Color Aquamarine { get { return namedColors["aquamarine"]; } } 166 public static Color Azure { get { return namedColors["azure"]; } } 167 public static Color Beige { get { return namedColors["beige"]; } } 168 public static Color Bisque { get { return namedColors["bisque"]; } } 169 public static Color Black { get { return namedColors["black"]; } } 170 public static Color BlanchedAlmond { get { return namedColors["blanchedalmond"]; } } 171 public static Color Blue { get { return namedColors["blue"]; } } 172 public static Color BlueViolet { get { return namedColors["blueviolet"]; } } 173 public static Color Brown { get { return namedColors["brown"]; } } 174 public static Color BurlyWood { get { return namedColors["burlywood"]; } } 175 public static Color CadetBlue { get { return namedColors["cadetblue"]; } } 176 public static Color Chartreuse { get { return namedColors["chartreuse"]; } } 177 public static Color Chocolate { get { return namedColors["chocolate"]; } } 178 public static Color Coral { get { return namedColors["coral"]; } } 179 public static Color Cornflower { get { return namedColors["cornflower"]; } } 180 public static Color Cornsilk { get { return namedColors["cornsilk"]; } } 181 public static Color Crimson { get { return namedColors["crimson"]; } } 182 public static Color Cyan { get { return namedColors["cyan"]; } } 183 public static Color DarkBlue { get { return namedColors["darkblue"]; } } 184 public static Color DarkCyan { get { return namedColors["darkcyan"]; } } 185 public static Color DarkGoldenrod { get { return namedColors["darkgoldenrod"]; } } 186 public static Color DarkGray { get { return namedColors["darkgray"]; } } 187 public static Color DarkGreen { get { return namedColors["darkgreen"]; } } 188 public static Color DarkKhaki { get { return namedColors["darkkhaki"]; } } 189 public static Color DarkMagenta { get { return namedColors["darkmagenta"]; } } 190 public static Color DarkOliveGreen { get { return namedColors["darkolivegreen"]; } } 191 public static Color DarkOrange { get { return namedColors["darkorange"]; } } 192 public static Color DarkOrchid { get { return namedColors["darkorchid"]; } } 193 public static Color DarkRed { get { return namedColors["darkred"]; } } 194 public static Color DarkSalmon { get { return namedColors["darksalmon"]; } } 195 public static Color DarkSeaGreen { get { return namedColors["darkseagreen"]; } } 196 public static Color DarkSlateBlue { get { return namedColors["darkslateblue"]; } } 197 public static Color DarkSlateGray { get { return namedColors["darkslategray"]; } } 198 public static Color DarkTurquoise { get { return namedColors["darkturquoise"]; } } 199 public static Color DarkViolet { get { return namedColors["darkviolet"]; } } 200 public static Color DeepPink { get { return namedColors["deeppink"]; } } 201 public static Color DeepSkyBlue { get { return namedColors["deepskyblue"]; } } 202 public static Color DimGray { get { return namedColors["dimgray"]; } } 203 public static Color DodgerBlue { get { return namedColors["dodgerblue"]; } } 204 public static Color Firebrick { get { return namedColors["firebrick"]; } } 205 public static Color FloralWhite { get { return namedColors["floralwhite"]; } } 206 public static Color ForestGreen { get { return namedColors["forestgreen"]; } } 207 public static Color Fuchsia { get { return namedColors["fuchsia"]; } } 208 public static Color Gainsboro { get { return namedColors["gainsboro"]; } } 209 public static Color GhostWhite { get { return namedColors["ghostwhite"]; } } 210 public static Color Gold { get { return namedColors["gold"]; } } 211 public static Color Goldenrod { get { return namedColors["goldenrod"]; } } 212 public static Color Gray { get { return namedColors["gray"]; } } 213 public static Color Green { get { return namedColors["green"]; } } 214 public static Color GreenYellow { get { return namedColors["greenyellow"]; } } 215 public static Color Honeydew { get { return namedColors["honeydew"]; } } 216 public static Color HotPink { get { return namedColors["hotpink"]; } } 217 public static Color IndianRed { get { return namedColors["indianred"]; } } 218 public static Color Indigo { get { return namedColors["indigo"]; } } 219 public static Color Ivory { get { return namedColors["ivory"]; } } 220 public static Color Khaki { get { return namedColors["khaki"]; } } 221 public static Color Lavender { get { return namedColors["lavender"]; } } 222 public static Color LavenderBlush { get { return namedColors["lavenderblush"]; } } 223 public static Color LawnGreen { get { return namedColors["lawngreen"]; } } 224 public static Color LemonChiffon { get { return namedColors["lemonchiffon"]; } } 225 public static Color LightBlue { get { return namedColors["lightblue"]; } } 226 public static Color LightCoral { get { return namedColors["lightcoral"]; } } 227 public static Color LightCyan { get { return namedColors["lightcyan"]; } } 228 public static Color LightGoldenrod { get { return namedColors["lightgoldenrod"]; } } 229 public static Color LightGray { get { return namedColors["lightgray"]; } } 230 public static Color LightGreen { get { return namedColors["lightgreen"]; } } 231 public static Color LightPink { get { return namedColors["lightpink"]; } } 232 public static Color LightSalmon { get { return namedColors["lightsalmon"]; } } 233 public static Color LightSeaGreen { get { return namedColors["lightseagreen"]; } } 234 public static Color LightSkyBlue { get { return namedColors["lightskyblue"]; } } 235 public static Color LightSlateGray { get { return namedColors["lightslategray"]; } } 236 public static Color LightSteelBlue { get { return namedColors["lightsteelblue"]; } } 237 public static Color LightYellow { get { return namedColors["lightyellow"]; } } 238 public static Color Lime { get { return namedColors["lime"]; } } 239 public static Color Limegreen { get { return namedColors["limegreen"]; } } 240 public static Color Linen { get { return namedColors["linen"]; } } 241 public static Color Magenta { get { return namedColors["magenta"]; } } 242 public static Color Maroon { get { return namedColors["maroon"]; } } 243 public static Color MediumAquamarine { get { return namedColors["mediumaquamarine"]; } } 244 public static Color MediumBlue { get { return namedColors["mediumblue"]; } } 245 public static Color MediumOrchid { get { return namedColors["mediumorchid"]; } } 246 public static Color MediumPurple { get { return namedColors["mediumpurple"]; } } 247 public static Color MediumSeaGreen { get { return namedColors["mediumseagreen"]; } } 248 public static Color MediumSlateBlue { get { return namedColors["mediumslateblue"]; } } 249 public static Color MediumSpringGreen { get { return namedColors["mediumspringgreen"]; } } 250 public static Color MediumTurquoise { get { return namedColors["mediumturquoise"]; } } 251 public static Color MediumVioletRed { get { return namedColors["mediumvioletred"]; } } 252 public static Color MidnightBlue { get { return namedColors["midnightblue"]; } } 253 public static Color MintCream { get { return namedColors["mintcream"]; } } 254 public static Color MistyRose { get { return namedColors["mistyrose"]; } } 255 public static Color Moccasin { get { return namedColors["moccasin"]; } } 256 public static Color NavajoWhite { get { return namedColors["navajowhite"]; } } 257 public static Color NavyBlue { get { return namedColors["navyblue"]; } } 258 public static Color OldLace { get { return namedColors["oldlace"]; } } 259 public static Color Olive { get { return namedColors["olive"]; } } 260 public static Color OliveDrab { get { return namedColors["olivedrab"]; } } 261 public static Color Orange { get { return namedColors["orange"]; } } 262 public static Color OrangeRed { get { return namedColors["orangered"]; } } 263 public static Color Orchid { get { return namedColors["orchid"]; } } 264 public static Color PaleGoldenrod { get { return namedColors["palegoldenrod"]; } } 265 public static Color PaleGreen { get { return namedColors["palegreen"]; } } 266 public static Color PaleTurquoise { get { return namedColors["paleturquoise"]; } } 267 public static Color PaleVioletRed { get { return namedColors["palevioletred"]; } } 268 public static Color PapayaWhip { get { return namedColors["papayawhip"]; } } 269 public static Color PeachPuff { get { return namedColors["peachpuff"]; } } 270 public static Color Peru { get { return namedColors["peru"]; } } 271 public static Color Pink { get { return namedColors["pink"]; } } 272 public static Color Plum { get { return namedColors["plum"]; } } 273 public static Color PowderBlue { get { return namedColors["powderblue"]; } } 274 public static Color Purple { get { return namedColors["purple"]; } } 275 public static Color RebeccaPurple { get { return namedColors["rebeccapurple"]; } } 276 public static Color Red { get { return namedColors["red"]; } } 277 public static Color RosyBrown { get { return namedColors["rosybrown"]; } } 278 public static Color RoyalBlue { get { return namedColors["royalblue"]; } } 279 public static Color SaddleBrown { get { return namedColors["saddlebrown"]; } } 280 public static Color Salmon { get { return namedColors["salmon"]; } } 281 public static Color SandyBrown { get { return namedColors["sandybrown"]; } } 282 public static Color SeaGreen { get { return namedColors["seagreen"]; } } 283 public static Color SeaShell { get { return namedColors["seashell"]; } } 284 public static Color Sienna { get { return namedColors["sienna"]; } } 285 public static Color Silver { get { return namedColors["silver"]; } } 286 public static Color SkyBlue { get { return namedColors["skyblue"]; } } 287 public static Color SlateBlue { get { return namedColors["slateblue"]; } } 288 public static Color SlateGray { get { return namedColors["slategray"]; } } 289 public static Color Snow { get { return namedColors["snow"]; } } 290 public static Color SpringGreen { get { return namedColors["springgreen"]; } } 291 public static Color SteelBlue { get { return namedColors["steelblue"]; } } 292 public static Color Tan { get { return namedColors["tan"]; } } 293 public static Color Teal { get { return namedColors["teal"]; } } 294 public static Color Thistle { get { return namedColors["thistle"]; } } 295 public static Color Tomato { get { return namedColors["tomato"]; } } 296 public static Color Transparent { get { return namedColors["transparent"]; } } 297 public static Color Turquoise { get { return namedColors["turquoise"]; } } 298 public static Color Violet { get { return namedColors["violet"]; } } 299 public static Color WebGreen { get { return namedColors["webgreen"]; } } 300 public static Color WebGray { get { return namedColors["webgray"]; } } 301 public static Color WebMaroon { get { return namedColors["webmaroon"]; } } 302 public static Color WebPurple { get { return namedColors["webpurple"]; } } 303 public static Color Wheat { get { return namedColors["wheat"]; } } 304 public static Color White { get { return namedColors["white"]; } } 305 public static Color WhiteSmoke { get { return namedColors["whitesmoke"]; } } 306 public static Color Yellow { get { return namedColors["yellow"]; } } 307 public static Color YellowGreen { get { return namedColors["yellowgreen"]; } } 308 } 309 } 310