named-colors.c (34426B)
1/* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, 13 * software distributed under the License is distributed on an 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 * KIND, either express or implied. See the License for the 16 * specific language governing permissions and limitations 17 * under the License. 18 */ 19 20#include "terminal/palette.h" 21 22#include <ctype.h> 23#include <stdlib.h> 24 25/** 26 * A guac_terminal_color definition associated with a descriptive name. 27 */ 28typedef struct guac_terminal_named_color { 29 30 /** 31 * The color associated with the name. 32 */ 33 guac_terminal_color color; 34 35 /** 36 * The name of the color. Each name must be lowercase and may not contain 37 * any whitespace. 38 */ 39 const char* name; 40 41} guac_terminal_named_color; 42 43/** 44 * An array of several colors and their corresponding names. This array must at 45 * least contain the color names accepted by xterm. 46 */ 47const guac_terminal_named_color GUAC_TERMINAL_NAMED_COLORS[] = { 48 49 /* Color names supported by xterm */ 50 51 {{ -1, 0xF0, 0xF8, 0xFF }, "aliceblue" }, 52 {{ -1, 0xFA, 0xEB, 0xD7 }, "antiquewhite" }, 53 {{ -1, 0xFF, 0xEF, 0xDB }, "antiquewhite1" }, 54 {{ -1, 0xEE, 0xDF, 0xCC }, "antiquewhite2" }, 55 {{ -1, 0xCD, 0xC0, 0xB0 }, "antiquewhite3" }, 56 {{ -1, 0x8B, 0x83, 0x78 }, "antiquewhite4" }, 57 {{ -1, 0x00, 0xFF, 0xFF }, "aqua" }, 58 {{ -1, 0x7F, 0xFF, 0xD4 }, "aquamarine" }, 59 {{ -1, 0x7F, 0xFF, 0xD4 }, "aquamarine1" }, 60 {{ -1, 0x76, 0xEE, 0xC6 }, "aquamarine2" }, 61 {{ -1, 0x66, 0xCD, 0xAA }, "aquamarine3" }, 62 {{ -1, 0x45, 0x8B, 0x74 }, "aquamarine4" }, 63 {{ -1, 0xF0, 0xFF, 0xFF }, "azure" }, 64 {{ -1, 0xF0, 0xFF, 0xFF }, "azure1" }, 65 {{ -1, 0xE0, 0xEE, 0xEE }, "azure2" }, 66 {{ -1, 0xC1, 0xCD, 0xCD }, "azure3" }, 67 {{ -1, 0x83, 0x8B, 0x8B }, "azure4" }, 68 {{ -1, 0xF5, 0xF5, 0xDC }, "beige" }, 69 {{ -1, 0xFF, 0xE4, 0xC4 }, "bisque" }, 70 {{ -1, 0xFF, 0xE4, 0xC4 }, "bisque1" }, 71 {{ -1, 0xEE, 0xD5, 0xB7 }, "bisque2" }, 72 {{ -1, 0xCD, 0xB7, 0x9E }, "bisque3" }, 73 {{ -1, 0x8B, 0x7D, 0x6B }, "bisque4" }, 74 {{ -1, 0x00, 0x00, 0x00 }, "black" }, 75 {{ -1, 0xFF, 0xEB, 0xCD }, "blanchedalmond" }, 76 {{ -1, 0x00, 0x00, 0xFF }, "blue" }, 77 {{ -1, 0x00, 0x00, 0xFF }, "blue1" }, 78 {{ -1, 0x00, 0x00, 0xEE }, "blue2" }, 79 {{ -1, 0x00, 0x00, 0xCD }, "blue3" }, 80 {{ -1, 0x00, 0x00, 0x8B }, "blue4" }, 81 {{ -1, 0x8A, 0x2B, 0xE2 }, "blueviolet" }, 82 {{ -1, 0xA5, 0x2A, 0x2A }, "brown" }, 83 {{ -1, 0xFF, 0x40, 0x40 }, "brown1" }, 84 {{ -1, 0xEE, 0x3B, 0x3B }, "brown2" }, 85 {{ -1, 0xCD, 0x33, 0x33 }, "brown3" }, 86 {{ -1, 0x8B, 0x23, 0x23 }, "brown4" }, 87 {{ -1, 0xDE, 0xB8, 0x87 }, "burlywood" }, 88 {{ -1, 0xFF, 0xD3, 0x9B }, "burlywood1" }, 89 {{ -1, 0xEE, 0xC5, 0x91 }, "burlywood2" }, 90 {{ -1, 0xCD, 0xAA, 0x7D }, "burlywood3" }, 91 {{ -1, 0x8B, 0x73, 0x55 }, "burlywood4" }, 92 {{ -1, 0x5F, 0x9E, 0xA0 }, "cadetblue" }, 93 {{ -1, 0x98, 0xF5, 0xFF }, "cadetblue1" }, 94 {{ -1, 0x8E, 0xE5, 0xEE }, "cadetblue2" }, 95 {{ -1, 0x7A, 0xC5, 0xCD }, "cadetblue3" }, 96 {{ -1, 0x53, 0x86, 0x8B }, "cadetblue4" }, 97 {{ -1, 0x7F, 0xFF, 0x00 }, "chartreuse" }, 98 {{ -1, 0x7F, 0xFF, 0x00 }, "chartreuse1" }, 99 {{ -1, 0x76, 0xEE, 0x00 }, "chartreuse2" }, 100 {{ -1, 0x66, 0xCD, 0x00 }, "chartreuse3" }, 101 {{ -1, 0x45, 0x8B, 0x00 }, "chartreuse4" }, 102 {{ -1, 0xD2, 0x69, 0x1E }, "chocolate" }, 103 {{ -1, 0xFF, 0x7F, 0x24 }, "chocolate1" }, 104 {{ -1, 0xEE, 0x76, 0x21 }, "chocolate2" }, 105 {{ -1, 0xCD, 0x66, 0x1D }, "chocolate3" }, 106 {{ -1, 0x8B, 0x45, 0x13 }, "chocolate4" }, 107 {{ -1, 0xFF, 0x7F, 0x50 }, "coral" }, 108 {{ -1, 0xFF, 0x72, 0x56 }, "coral1" }, 109 {{ -1, 0xEE, 0x6A, 0x50 }, "coral2" }, 110 {{ -1, 0xCD, 0x5B, 0x45 }, "coral3" }, 111 {{ -1, 0x8B, 0x3E, 0x2F }, "coral4" }, 112 {{ -1, 0x64, 0x95, 0xED }, "cornflowerblue" }, 113 {{ -1, 0xFF, 0xF8, 0xDC }, "cornsilk" }, 114 {{ -1, 0xFF, 0xF8, 0xDC }, "cornsilk1" }, 115 {{ -1, 0xEE, 0xE8, 0xCD }, "cornsilk2" }, 116 {{ -1, 0xCD, 0xC8, 0xB1 }, "cornsilk3" }, 117 {{ -1, 0x8B, 0x88, 0x78 }, "cornsilk4" }, 118 {{ -1, 0xDC, 0x14, 0x3C }, "crimson" }, 119 {{ -1, 0x00, 0xFF, 0xFF }, "cyan" }, 120 {{ -1, 0x00, 0xFF, 0xFF }, "cyan1" }, 121 {{ -1, 0x00, 0xEE, 0xEE }, "cyan2" }, 122 {{ -1, 0x00, 0xCD, 0xCD }, "cyan3" }, 123 {{ -1, 0x00, 0x8B, 0x8B }, "cyan4" }, 124 {{ -1, 0x00, 0x00, 0x8B }, "darkblue" }, 125 {{ -1, 0x00, 0x8B, 0x8B }, "darkcyan" }, 126 {{ -1, 0xB8, 0x86, 0x0B }, "darkgoldenrod" }, 127 {{ -1, 0xFF, 0xB9, 0x0F }, "darkgoldenrod1" }, 128 {{ -1, 0xEE, 0xAD, 0x0E }, "darkgoldenrod2" }, 129 {{ -1, 0xCD, 0x95, 0x0C }, "darkgoldenrod3" }, 130 {{ -1, 0x8B, 0x65, 0x08 }, "darkgoldenrod4" }, 131 {{ -1, 0xA9, 0xA9, 0xA9 }, "darkgray" }, 132 {{ -1, 0x00, 0x64, 0x00 }, "darkgreen" }, 133 {{ -1, 0xA9, 0xA9, 0xA9 }, "darkgrey" }, 134 {{ -1, 0xBD, 0xB7, 0x6B }, "darkkhaki" }, 135 {{ -1, 0x8B, 0x00, 0x8B }, "darkmagenta" }, 136 {{ -1, 0x55, 0x6B, 0x2F }, "darkolivegreen" }, 137 {{ -1, 0xCA, 0xFF, 0x70 }, "darkolivegreen1" }, 138 {{ -1, 0xBC, 0xEE, 0x68 }, "darkolivegreen2" }, 139 {{ -1, 0xA2, 0xCD, 0x5A }, "darkolivegreen3" }, 140 {{ -1, 0x6E, 0x8B, 0x3D }, "darkolivegreen4" }, 141 {{ -1, 0xFF, 0x8C, 0x00 }, "darkorange" }, 142 {{ -1, 0xFF, 0x7F, 0x00 }, "darkorange1" }, 143 {{ -1, 0xEE, 0x76, 0x00 }, "darkorange2" }, 144 {{ -1, 0xCD, 0x66, 0x00 }, "darkorange3" }, 145 {{ -1, 0x8B, 0x45, 0x00 }, "darkorange4" }, 146 {{ -1, 0x99, 0x32, 0xCC }, "darkorchid" }, 147 {{ -1, 0xBF, 0x3E, 0xFF }, "darkorchid1" }, 148 {{ -1, 0xB2, 0x3A, 0xEE }, "darkorchid2" }, 149 {{ -1, 0x9A, 0x32, 0xCD }, "darkorchid3" }, 150 {{ -1, 0x68, 0x22, 0x8B }, "darkorchid4" }, 151 {{ -1, 0x8B, 0x00, 0x00 }, "darkred" }, 152 {{ -1, 0xE9, 0x96, 0x7A }, "darksalmon" }, 153 {{ -1, 0x8F, 0xBC, 0x8F }, "darkseagreen" }, 154 {{ -1, 0xC1, 0xFF, 0xC1 }, "darkseagreen1" }, 155 {{ -1, 0xB4, 0xEE, 0xB4 }, "darkseagreen2" }, 156 {{ -1, 0x9B, 0xCD, 0x9B }, "darkseagreen3" }, 157 {{ -1, 0x69, 0x8B, 0x69 }, "darkseagreen4" }, 158 {{ -1, 0x48, 0x3D, 0x8B }, "darkslateblue" }, 159 {{ -1, 0x2F, 0x4F, 0x4F }, "darkslategray" }, 160 {{ -1, 0x97, 0xFF, 0xFF }, "darkslategray1" }, 161 {{ -1, 0x8D, 0xEE, 0xEE }, "darkslategray2" }, 162 {{ -1, 0x79, 0xCD, 0xCD }, "darkslategray3" }, 163 {{ -1, 0x52, 0x8B, 0x8B }, "darkslategray4" }, 164 {{ -1, 0x2F, 0x4F, 0x4F }, "darkslategrey" }, 165 {{ -1, 0x00, 0xCE, 0xD1 }, "darkturquoise" }, 166 {{ -1, 0x94, 0x00, 0xD3 }, "darkviolet" }, 167 {{ -1, 0xFF, 0x14, 0x93 }, "deeppink" }, 168 {{ -1, 0xFF, 0x14, 0x93 }, "deeppink1" }, 169 {{ -1, 0xEE, 0x12, 0x89 }, "deeppink2" }, 170 {{ -1, 0xCD, 0x10, 0x76 }, "deeppink3" }, 171 {{ -1, 0x8B, 0x0A, 0x50 }, "deeppink4" }, 172 {{ -1, 0x00, 0xBF, 0xFF }, "deepskyblue" }, 173 {{ -1, 0x00, 0xBF, 0xFF }, "deepskyblue1" }, 174 {{ -1, 0x00, 0xB2, 0xEE }, "deepskyblue2" }, 175 {{ -1, 0x00, 0x9A, 0xCD }, "deepskyblue3" }, 176 {{ -1, 0x00, 0x68, 0x8B }, "deepskyblue4" }, 177 {{ -1, 0x69, 0x69, 0x69 }, "dimgray" }, 178 {{ -1, 0x69, 0x69, 0x69 }, "dimgrey" }, 179 {{ -1, 0x1E, 0x90, 0xFF }, "dodgerblue" }, 180 {{ -1, 0x1E, 0x90, 0xFF }, "dodgerblue1" }, 181 {{ -1, 0x1C, 0x86, 0xEE }, "dodgerblue2" }, 182 {{ -1, 0x18, 0x74, 0xCD }, "dodgerblue3" }, 183 {{ -1, 0x10, 0x4E, 0x8B }, "dodgerblue4" }, 184 {{ -1, 0xB2, 0x22, 0x22 }, "firebrick" }, 185 {{ -1, 0xFF, 0x30, 0x30 }, "firebrick1" }, 186 {{ -1, 0xEE, 0x2C, 0x2C }, "firebrick2" }, 187 {{ -1, 0xCD, 0x26, 0x26 }, "firebrick3" }, 188 {{ -1, 0x8B, 0x1A, 0x1A }, "firebrick4" }, 189 {{ -1, 0xFF, 0xFA, 0xF0 }, "floralwhite" }, 190 {{ -1, 0x22, 0x8B, 0x22 }, "forestgreen" }, 191 {{ -1, 0xFF, 0x00, 0xFF }, "fuchsia" }, 192 {{ -1, 0xDC, 0xDC, 0xDC }, "gainsboro" }, 193 {{ -1, 0xF8, 0xF8, 0xFF }, "ghostwhite" }, 194 {{ -1, 0xFF, 0xD7, 0x00 }, "gold" }, 195 {{ -1, 0xFF, 0xD7, 0x00 }, "gold1" }, 196 {{ -1, 0xEE, 0xC9, 0x00 }, "gold2" }, 197 {{ -1, 0xCD, 0xAD, 0x00 }, "gold3" }, 198 {{ -1, 0x8B, 0x75, 0x00 }, "gold4" }, 199 {{ -1, 0xDA, 0xA5, 0x20 }, "goldenrod" }, 200 {{ -1, 0xFF, 0xC1, 0x25 }, "goldenrod1" }, 201 {{ -1, 0xEE, 0xB4, 0x22 }, "goldenrod2" }, 202 {{ -1, 0xCD, 0x9B, 0x1D }, "goldenrod3" }, 203 {{ -1, 0x8B, 0x69, 0x14 }, "goldenrod4" }, 204 {{ -1, 0xBE, 0xBE, 0xBE }, "gray" }, 205 {{ -1, 0x00, 0x00, 0x00 }, "gray0" }, 206 {{ -1, 0x03, 0x03, 0x03 }, "gray1" }, 207 {{ -1, 0x1A, 0x1A, 0x1A }, "gray10" }, 208 {{ -1, 0xFF, 0xFF, 0xFF }, "gray100" }, 209 {{ -1, 0x1C, 0x1C, 0x1C }, "gray11" }, 210 {{ -1, 0x1F, 0x1F, 0x1F }, "gray12" }, 211 {{ -1, 0x21, 0x21, 0x21 }, "gray13" }, 212 {{ -1, 0x24, 0x24, 0x24 }, "gray14" }, 213 {{ -1, 0x26, 0x26, 0x26 }, "gray15" }, 214 {{ -1, 0x29, 0x29, 0x29 }, "gray16" }, 215 {{ -1, 0x2B, 0x2B, 0x2B }, "gray17" }, 216 {{ -1, 0x2E, 0x2E, 0x2E }, "gray18" }, 217 {{ -1, 0x30, 0x30, 0x30 }, "gray19" }, 218 {{ -1, 0x05, 0x05, 0x05 }, "gray2" }, 219 {{ -1, 0x33, 0x33, 0x33 }, "gray20" }, 220 {{ -1, 0x36, 0x36, 0x36 }, "gray21" }, 221 {{ -1, 0x38, 0x38, 0x38 }, "gray22" }, 222 {{ -1, 0x3B, 0x3B, 0x3B }, "gray23" }, 223 {{ -1, 0x3D, 0x3D, 0x3D }, "gray24" }, 224 {{ -1, 0x40, 0x40, 0x40 }, "gray25" }, 225 {{ -1, 0x42, 0x42, 0x42 }, "gray26" }, 226 {{ -1, 0x45, 0x45, 0x45 }, "gray27" }, 227 {{ -1, 0x47, 0x47, 0x47 }, "gray28" }, 228 {{ -1, 0x4A, 0x4A, 0x4A }, "gray29" }, 229 {{ -1, 0x08, 0x08, 0x08 }, "gray3" }, 230 {{ -1, 0x4D, 0x4D, 0x4D }, "gray30" }, 231 {{ -1, 0x4F, 0x4F, 0x4F }, "gray31" }, 232 {{ -1, 0x52, 0x52, 0x52 }, "gray32" }, 233 {{ -1, 0x54, 0x54, 0x54 }, "gray33" }, 234 {{ -1, 0x57, 0x57, 0x57 }, "gray34" }, 235 {{ -1, 0x59, 0x59, 0x59 }, "gray35" }, 236 {{ -1, 0x5C, 0x5C, 0x5C }, "gray36" }, 237 {{ -1, 0x5E, 0x5E, 0x5E }, "gray37" }, 238 {{ -1, 0x61, 0x61, 0x61 }, "gray38" }, 239 {{ -1, 0x63, 0x63, 0x63 }, "gray39" }, 240 {{ -1, 0x0A, 0x0A, 0x0A }, "gray4" }, 241 {{ -1, 0x66, 0x66, 0x66 }, "gray40" }, 242 {{ -1, 0x69, 0x69, 0x69 }, "gray41" }, 243 {{ -1, 0x6B, 0x6B, 0x6B }, "gray42" }, 244 {{ -1, 0x6E, 0x6E, 0x6E }, "gray43" }, 245 {{ -1, 0x70, 0x70, 0x70 }, "gray44" }, 246 {{ -1, 0x73, 0x73, 0x73 }, "gray45" }, 247 {{ -1, 0x75, 0x75, 0x75 }, "gray46" }, 248 {{ -1, 0x78, 0x78, 0x78 }, "gray47" }, 249 {{ -1, 0x7A, 0x7A, 0x7A }, "gray48" }, 250 {{ -1, 0x7D, 0x7D, 0x7D }, "gray49" }, 251 {{ -1, 0x0D, 0x0D, 0x0D }, "gray5" }, 252 {{ -1, 0x7F, 0x7F, 0x7F }, "gray50" }, 253 {{ -1, 0x82, 0x82, 0x82 }, "gray51" }, 254 {{ -1, 0x85, 0x85, 0x85 }, "gray52" }, 255 {{ -1, 0x87, 0x87, 0x87 }, "gray53" }, 256 {{ -1, 0x8A, 0x8A, 0x8A }, "gray54" }, 257 {{ -1, 0x8C, 0x8C, 0x8C }, "gray55" }, 258 {{ -1, 0x8F, 0x8F, 0x8F }, "gray56" }, 259 {{ -1, 0x91, 0x91, 0x91 }, "gray57" }, 260 {{ -1, 0x94, 0x94, 0x94 }, "gray58" }, 261 {{ -1, 0x96, 0x96, 0x96 }, "gray59" }, 262 {{ -1, 0x0F, 0x0F, 0x0F }, "gray6" }, 263 {{ -1, 0x99, 0x99, 0x99 }, "gray60" }, 264 {{ -1, 0x9C, 0x9C, 0x9C }, "gray61" }, 265 {{ -1, 0x9E, 0x9E, 0x9E }, "gray62" }, 266 {{ -1, 0xA1, 0xA1, 0xA1 }, "gray63" }, 267 {{ -1, 0xA3, 0xA3, 0xA3 }, "gray64" }, 268 {{ -1, 0xA6, 0xA6, 0xA6 }, "gray65" }, 269 {{ -1, 0xA8, 0xA8, 0xA8 }, "gray66" }, 270 {{ -1, 0xAB, 0xAB, 0xAB }, "gray67" }, 271 {{ -1, 0xAD, 0xAD, 0xAD }, "gray68" }, 272 {{ -1, 0xB0, 0xB0, 0xB0 }, "gray69" }, 273 {{ -1, 0x12, 0x12, 0x12 }, "gray7" }, 274 {{ -1, 0xB3, 0xB3, 0xB3 }, "gray70" }, 275 {{ -1, 0xB5, 0xB5, 0xB5 }, "gray71" }, 276 {{ -1, 0xB8, 0xB8, 0xB8 }, "gray72" }, 277 {{ -1, 0xBA, 0xBA, 0xBA }, "gray73" }, 278 {{ -1, 0xBD, 0xBD, 0xBD }, "gray74" }, 279 {{ -1, 0xBF, 0xBF, 0xBF }, "gray75" }, 280 {{ -1, 0xC2, 0xC2, 0xC2 }, "gray76" }, 281 {{ -1, 0xC4, 0xC4, 0xC4 }, "gray77" }, 282 {{ -1, 0xC7, 0xC7, 0xC7 }, "gray78" }, 283 {{ -1, 0xC9, 0xC9, 0xC9 }, "gray79" }, 284 {{ -1, 0x14, 0x14, 0x14 }, "gray8" }, 285 {{ -1, 0xCC, 0xCC, 0xCC }, "gray80" }, 286 {{ -1, 0xCF, 0xCF, 0xCF }, "gray81" }, 287 {{ -1, 0xD1, 0xD1, 0xD1 }, "gray82" }, 288 {{ -1, 0xD4, 0xD4, 0xD4 }, "gray83" }, 289 {{ -1, 0xD6, 0xD6, 0xD6 }, "gray84" }, 290 {{ -1, 0xD9, 0xD9, 0xD9 }, "gray85" }, 291 {{ -1, 0xDB, 0xDB, 0xDB }, "gray86" }, 292 {{ -1, 0xDE, 0xDE, 0xDE }, "gray87" }, 293 {{ -1, 0xE0, 0xE0, 0xE0 }, "gray88" }, 294 {{ -1, 0xE3, 0xE3, 0xE3 }, "gray89" }, 295 {{ -1, 0x17, 0x17, 0x17 }, "gray9" }, 296 {{ -1, 0xE5, 0xE5, 0xE5 }, "gray90" }, 297 {{ -1, 0xE8, 0xE8, 0xE8 }, "gray91" }, 298 {{ -1, 0xEB, 0xEB, 0xEB }, "gray92" }, 299 {{ -1, 0xED, 0xED, 0xED }, "gray93" }, 300 {{ -1, 0xF0, 0xF0, 0xF0 }, "gray94" }, 301 {{ -1, 0xF2, 0xF2, 0xF2 }, "gray95" }, 302 {{ -1, 0xF5, 0xF5, 0xF5 }, "gray96" }, 303 {{ -1, 0xF7, 0xF7, 0xF7 }, "gray97" }, 304 {{ -1, 0xFA, 0xFA, 0xFA }, "gray98" }, 305 {{ -1, 0xFC, 0xFC, 0xFC }, "gray99" }, 306 {{ -1, 0x00, 0xFF, 0x00 }, "green" }, 307 {{ -1, 0x00, 0xFF, 0x00 }, "green1" }, 308 {{ -1, 0x00, 0xEE, 0x00 }, "green2" }, 309 {{ -1, 0x00, 0xCD, 0x00 }, "green3" }, 310 {{ -1, 0x00, 0x8B, 0x00 }, "green4" }, 311 {{ -1, 0xAD, 0xFF, 0x2F }, "greenyellow" }, 312 {{ -1, 0xBE, 0xBE, 0xBE }, "grey" }, 313 {{ -1, 0x00, 0x00, 0x00 }, "grey0" }, 314 {{ -1, 0x03, 0x03, 0x03 }, "grey1" }, 315 {{ -1, 0x1A, 0x1A, 0x1A }, "grey10" }, 316 {{ -1, 0xFF, 0xFF, 0xFF }, "grey100" }, 317 {{ -1, 0x1C, 0x1C, 0x1C }, "grey11" }, 318 {{ -1, 0x1F, 0x1F, 0x1F }, "grey12" }, 319 {{ -1, 0x21, 0x21, 0x21 }, "grey13" }, 320 {{ -1, 0x24, 0x24, 0x24 }, "grey14" }, 321 {{ -1, 0x26, 0x26, 0x26 }, "grey15" }, 322 {{ -1, 0x29, 0x29, 0x29 }, "grey16" }, 323 {{ -1, 0x2B, 0x2B, 0x2B }, "grey17" }, 324 {{ -1, 0x2E, 0x2E, 0x2E }, "grey18" }, 325 {{ -1, 0x30, 0x30, 0x30 }, "grey19" }, 326 {{ -1, 0x05, 0x05, 0x05 }, "grey2" }, 327 {{ -1, 0x33, 0x33, 0x33 }, "grey20" }, 328 {{ -1, 0x36, 0x36, 0x36 }, "grey21" }, 329 {{ -1, 0x38, 0x38, 0x38 }, "grey22" }, 330 {{ -1, 0x3B, 0x3B, 0x3B }, "grey23" }, 331 {{ -1, 0x3D, 0x3D, 0x3D }, "grey24" }, 332 {{ -1, 0x40, 0x40, 0x40 }, "grey25" }, 333 {{ -1, 0x42, 0x42, 0x42 }, "grey26" }, 334 {{ -1, 0x45, 0x45, 0x45 }, "grey27" }, 335 {{ -1, 0x47, 0x47, 0x47 }, "grey28" }, 336 {{ -1, 0x4A, 0x4A, 0x4A }, "grey29" }, 337 {{ -1, 0x08, 0x08, 0x08 }, "grey3" }, 338 {{ -1, 0x4D, 0x4D, 0x4D }, "grey30" }, 339 {{ -1, 0x4F, 0x4F, 0x4F }, "grey31" }, 340 {{ -1, 0x52, 0x52, 0x52 }, "grey32" }, 341 {{ -1, 0x54, 0x54, 0x54 }, "grey33" }, 342 {{ -1, 0x57, 0x57, 0x57 }, "grey34" }, 343 {{ -1, 0x59, 0x59, 0x59 }, "grey35" }, 344 {{ -1, 0x5C, 0x5C, 0x5C }, "grey36" }, 345 {{ -1, 0x5E, 0x5E, 0x5E }, "grey37" }, 346 {{ -1, 0x61, 0x61, 0x61 }, "grey38" }, 347 {{ -1, 0x63, 0x63, 0x63 }, "grey39" }, 348 {{ -1, 0x0A, 0x0A, 0x0A }, "grey4" }, 349 {{ -1, 0x66, 0x66, 0x66 }, "grey40" }, 350 {{ -1, 0x69, 0x69, 0x69 }, "grey41" }, 351 {{ -1, 0x6B, 0x6B, 0x6B }, "grey42" }, 352 {{ -1, 0x6E, 0x6E, 0x6E }, "grey43" }, 353 {{ -1, 0x70, 0x70, 0x70 }, "grey44" }, 354 {{ -1, 0x73, 0x73, 0x73 }, "grey45" }, 355 {{ -1, 0x75, 0x75, 0x75 }, "grey46" }, 356 {{ -1, 0x78, 0x78, 0x78 }, "grey47" }, 357 {{ -1, 0x7A, 0x7A, 0x7A }, "grey48" }, 358 {{ -1, 0x7D, 0x7D, 0x7D }, "grey49" }, 359 {{ -1, 0x0D, 0x0D, 0x0D }, "grey5" }, 360 {{ -1, 0x7F, 0x7F, 0x7F }, "grey50" }, 361 {{ -1, 0x82, 0x82, 0x82 }, "grey51" }, 362 {{ -1, 0x85, 0x85, 0x85 }, "grey52" }, 363 {{ -1, 0x87, 0x87, 0x87 }, "grey53" }, 364 {{ -1, 0x8A, 0x8A, 0x8A }, "grey54" }, 365 {{ -1, 0x8C, 0x8C, 0x8C }, "grey55" }, 366 {{ -1, 0x8F, 0x8F, 0x8F }, "grey56" }, 367 {{ -1, 0x91, 0x91, 0x91 }, "grey57" }, 368 {{ -1, 0x94, 0x94, 0x94 }, "grey58" }, 369 {{ -1, 0x96, 0x96, 0x96 }, "grey59" }, 370 {{ -1, 0x0F, 0x0F, 0x0F }, "grey6" }, 371 {{ -1, 0x99, 0x99, 0x99 }, "grey60" }, 372 {{ -1, 0x9C, 0x9C, 0x9C }, "grey61" }, 373 {{ -1, 0x9E, 0x9E, 0x9E }, "grey62" }, 374 {{ -1, 0xA1, 0xA1, 0xA1 }, "grey63" }, 375 {{ -1, 0xA3, 0xA3, 0xA3 }, "grey64" }, 376 {{ -1, 0xA6, 0xA6, 0xA6 }, "grey65" }, 377 {{ -1, 0xA8, 0xA8, 0xA8 }, "grey66" }, 378 {{ -1, 0xAB, 0xAB, 0xAB }, "grey67" }, 379 {{ -1, 0xAD, 0xAD, 0xAD }, "grey68" }, 380 {{ -1, 0xB0, 0xB0, 0xB0 }, "grey69" }, 381 {{ -1, 0x12, 0x12, 0x12 }, "grey7" }, 382 {{ -1, 0xB3, 0xB3, 0xB3 }, "grey70" }, 383 {{ -1, 0xB5, 0xB5, 0xB5 }, "grey71" }, 384 {{ -1, 0xB8, 0xB8, 0xB8 }, "grey72" }, 385 {{ -1, 0xBA, 0xBA, 0xBA }, "grey73" }, 386 {{ -1, 0xBD, 0xBD, 0xBD }, "grey74" }, 387 {{ -1, 0xBF, 0xBF, 0xBF }, "grey75" }, 388 {{ -1, 0xC2, 0xC2, 0xC2 }, "grey76" }, 389 {{ -1, 0xC4, 0xC4, 0xC4 }, "grey77" }, 390 {{ -1, 0xC7, 0xC7, 0xC7 }, "grey78" }, 391 {{ -1, 0xC9, 0xC9, 0xC9 }, "grey79" }, 392 {{ -1, 0x14, 0x14, 0x14 }, "grey8" }, 393 {{ -1, 0xCC, 0xCC, 0xCC }, "grey80" }, 394 {{ -1, 0xCF, 0xCF, 0xCF }, "grey81" }, 395 {{ -1, 0xD1, 0xD1, 0xD1 }, "grey82" }, 396 {{ -1, 0xD4, 0xD4, 0xD4 }, "grey83" }, 397 {{ -1, 0xD6, 0xD6, 0xD6 }, "grey84" }, 398 {{ -1, 0xD9, 0xD9, 0xD9 }, "grey85" }, 399 {{ -1, 0xDB, 0xDB, 0xDB }, "grey86" }, 400 {{ -1, 0xDE, 0xDE, 0xDE }, "grey87" }, 401 {{ -1, 0xE0, 0xE0, 0xE0 }, "grey88" }, 402 {{ -1, 0xE3, 0xE3, 0xE3 }, "grey89" }, 403 {{ -1, 0x17, 0x17, 0x17 }, "grey9" }, 404 {{ -1, 0xE5, 0xE5, 0xE5 }, "grey90" }, 405 {{ -1, 0xE8, 0xE8, 0xE8 }, "grey91" }, 406 {{ -1, 0xEB, 0xEB, 0xEB }, "grey92" }, 407 {{ -1, 0xED, 0xED, 0xED }, "grey93" }, 408 {{ -1, 0xF0, 0xF0, 0xF0 }, "grey94" }, 409 {{ -1, 0xF2, 0xF2, 0xF2 }, "grey95" }, 410 {{ -1, 0xF5, 0xF5, 0xF5 }, "grey96" }, 411 {{ -1, 0xF7, 0xF7, 0xF7 }, "grey97" }, 412 {{ -1, 0xFA, 0xFA, 0xFA }, "grey98" }, 413 {{ -1, 0xFC, 0xFC, 0xFC }, "grey99" }, 414 {{ -1, 0xF0, 0xFF, 0xF0 }, "honeydew" }, 415 {{ -1, 0xF0, 0xFF, 0xF0 }, "honeydew1" }, 416 {{ -1, 0xE0, 0xEE, 0xE0 }, "honeydew2" }, 417 {{ -1, 0xC1, 0xCD, 0xC1 }, "honeydew3" }, 418 {{ -1, 0x83, 0x8B, 0x83 }, "honeydew4" }, 419 {{ -1, 0xFF, 0x69, 0xB4 }, "hotpink" }, 420 {{ -1, 0xFF, 0x6E, 0xB4 }, "hotpink1" }, 421 {{ -1, 0xEE, 0x6A, 0xA7 }, "hotpink2" }, 422 {{ -1, 0xCD, 0x60, 0x90 }, "hotpink3" }, 423 {{ -1, 0x8B, 0x3A, 0x62 }, "hotpink4" }, 424 {{ -1, 0xCD, 0x5C, 0x5C }, "indianred" }, 425 {{ -1, 0xFF, 0x6A, 0x6A }, "indianred1" }, 426 {{ -1, 0xEE, 0x63, 0x63 }, "indianred2" }, 427 {{ -1, 0xCD, 0x55, 0x55 }, "indianred3" }, 428 {{ -1, 0x8B, 0x3A, 0x3A }, "indianred4" }, 429 {{ -1, 0x4B, 0x00, 0x82 }, "indigo" }, 430 {{ -1, 0xFF, 0xFF, 0xF0 }, "ivory" }, 431 {{ -1, 0xFF, 0xFF, 0xF0 }, "ivory1" }, 432 {{ -1, 0xEE, 0xEE, 0xE0 }, "ivory2" }, 433 {{ -1, 0xCD, 0xCD, 0xC1 }, "ivory3" }, 434 {{ -1, 0x8B, 0x8B, 0x83 }, "ivory4" }, 435 {{ -1, 0xF0, 0xE6, 0x8C }, "khaki" }, 436 {{ -1, 0xFF, 0xF6, 0x8F }, "khaki1" }, 437 {{ -1, 0xEE, 0xE6, 0x85 }, "khaki2" }, 438 {{ -1, 0xCD, 0xC6, 0x73 }, "khaki3" }, 439 {{ -1, 0x8B, 0x86, 0x4E }, "khaki4" }, 440 {{ -1, 0xE6, 0xE6, 0xFA }, "lavender" }, 441 {{ -1, 0xFF, 0xF0, 0xF5 }, "lavenderblush" }, 442 {{ -1, 0xFF, 0xF0, 0xF5 }, "lavenderblush1" }, 443 {{ -1, 0xEE, 0xE0, 0xE5 }, "lavenderblush2" }, 444 {{ -1, 0xCD, 0xC1, 0xC5 }, "lavenderblush3" }, 445 {{ -1, 0x8B, 0x83, 0x86 }, "lavenderblush4" }, 446 {{ -1, 0x7C, 0xFC, 0x00 }, "lawngreen" }, 447 {{ -1, 0xFF, 0xFA, 0xCD }, "lemonchiffon" }, 448 {{ -1, 0xFF, 0xFA, 0xCD }, "lemonchiffon1" }, 449 {{ -1, 0xEE, 0xE9, 0xBF }, "lemonchiffon2" }, 450 {{ -1, 0xCD, 0xC9, 0xA5 }, "lemonchiffon3" }, 451 {{ -1, 0x8B, 0x89, 0x70 }, "lemonchiffon4" }, 452 {{ -1, 0xAD, 0xD8, 0xE6 }, "lightblue" }, 453 {{ -1, 0xBF, 0xEF, 0xFF }, "lightblue1" }, 454 {{ -1, 0xB2, 0xDF, 0xEE }, "lightblue2" }, 455 {{ -1, 0x9A, 0xC0, 0xCD }, "lightblue3" }, 456 {{ -1, 0x68, 0x83, 0x8B }, "lightblue4" }, 457 {{ -1, 0xF0, 0x80, 0x80 }, "lightcoral" }, 458 {{ -1, 0xE0, 0xFF, 0xFF }, "lightcyan" }, 459 {{ -1, 0xE0, 0xFF, 0xFF }, "lightcyan1" }, 460 {{ -1, 0xD1, 0xEE, 0xEE }, "lightcyan2" }, 461 {{ -1, 0xB4, 0xCD, 0xCD }, "lightcyan3" }, 462 {{ -1, 0x7A, 0x8B, 0x8B }, "lightcyan4" }, 463 {{ -1, 0xEE, 0xDD, 0x82 }, "lightgoldenrod" }, 464 {{ -1, 0xFF, 0xEC, 0x8B }, "lightgoldenrod1" }, 465 {{ -1, 0xEE, 0xDC, 0x82 }, "lightgoldenrod2" }, 466 {{ -1, 0xCD, 0xBE, 0x70 }, "lightgoldenrod3" }, 467 {{ -1, 0x8B, 0x81, 0x4C }, "lightgoldenrod4" }, 468 {{ -1, 0xFA, 0xFA, 0xD2 }, "lightgoldenrodyellow" }, 469 {{ -1, 0xD3, 0xD3, 0xD3 }, "lightgray" }, 470 {{ -1, 0x90, 0xEE, 0x90 }, "lightgreen" }, 471 {{ -1, 0xD3, 0xD3, 0xD3 }, "lightgrey" }, 472 {{ -1, 0xFF, 0xB6, 0xC1 }, "lightpink" }, 473 {{ -1, 0xFF, 0xAE, 0xB9 }, "lightpink1" }, 474 {{ -1, 0xEE, 0xA2, 0xAD }, "lightpink2" }, 475 {{ -1, 0xCD, 0x8C, 0x95 }, "lightpink3" }, 476 {{ -1, 0x8B, 0x5F, 0x65 }, "lightpink4" }, 477 {{ -1, 0xFF, 0xA0, 0x7A }, "lightsalmon" }, 478 {{ -1, 0xFF, 0xA0, 0x7A }, "lightsalmon1" }, 479 {{ -1, 0xEE, 0x95, 0x72 }, "lightsalmon2" }, 480 {{ -1, 0xCD, 0x81, 0x62 }, "lightsalmon3" }, 481 {{ -1, 0x8B, 0x57, 0x42 }, "lightsalmon4" }, 482 {{ -1, 0x20, 0xB2, 0xAA }, "lightseagreen" }, 483 {{ -1, 0x87, 0xCE, 0xFA }, "lightskyblue" }, 484 {{ -1, 0xB0, 0xE2, 0xFF }, "lightskyblue1" }, 485 {{ -1, 0xA4, 0xD3, 0xEE }, "lightskyblue2" }, 486 {{ -1, 0x8D, 0xB6, 0xCD }, "lightskyblue3" }, 487 {{ -1, 0x60, 0x7B, 0x8B }, "lightskyblue4" }, 488 {{ -1, 0x84, 0x70, 0xFF }, "lightslateblue" }, 489 {{ -1, 0x77, 0x88, 0x99 }, "lightslategray" }, 490 {{ -1, 0x77, 0x88, 0x99 }, "lightslategrey" }, 491 {{ -1, 0xB0, 0xC4, 0xDE }, "lightsteelblue" }, 492 {{ -1, 0xCA, 0xE1, 0xFF }, "lightsteelblue1" }, 493 {{ -1, 0xBC, 0xD2, 0xEE }, "lightsteelblue2" }, 494 {{ -1, 0xA2, 0xB5, 0xCD }, "lightsteelblue3" }, 495 {{ -1, 0x6E, 0x7B, 0x8B }, "lightsteelblue4" }, 496 {{ -1, 0xFF, 0xFF, 0xE0 }, "lightyellow" }, 497 {{ -1, 0xFF, 0xFF, 0xE0 }, "lightyellow1" }, 498 {{ -1, 0xEE, 0xEE, 0xD1 }, "lightyellow2" }, 499 {{ -1, 0xCD, 0xCD, 0xB4 }, "lightyellow3" }, 500 {{ -1, 0x8B, 0x8B, 0x7A }, "lightyellow4" }, 501 {{ -1, 0x00, 0xFF, 0x00 }, "lime" }, 502 {{ -1, 0x32, 0xCD, 0x32 }, "limegreen" }, 503 {{ -1, 0xFA, 0xF0, 0xE6 }, "linen" }, 504 {{ -1, 0xFF, 0x00, 0xFF }, "magenta" }, 505 {{ -1, 0xFF, 0x00, 0xFF }, "magenta1" }, 506 {{ -1, 0xEE, 0x00, 0xEE }, "magenta2" }, 507 {{ -1, 0xCD, 0x00, 0xCD }, "magenta3" }, 508 {{ -1, 0x8B, 0x00, 0x8B }, "magenta4" }, 509 {{ -1, 0xB0, 0x30, 0x60 }, "maroon" }, 510 {{ -1, 0xFF, 0x34, 0xB3 }, "maroon1" }, 511 {{ -1, 0xEE, 0x30, 0xA7 }, "maroon2" }, 512 {{ -1, 0xCD, 0x29, 0x90 }, "maroon3" }, 513 {{ -1, 0x8B, 0x1C, 0x62 }, "maroon4" }, 514 {{ -1, 0x66, 0xCD, 0xAA }, "mediumaquamarine" }, 515 {{ -1, 0x00, 0x00, 0xCD }, "mediumblue" }, 516 {{ -1, 0xBA, 0x55, 0xD3 }, "mediumorchid" }, 517 {{ -1, 0xE0, 0x66, 0xFF }, "mediumorchid1" }, 518 {{ -1, 0xD1, 0x5F, 0xEE }, "mediumorchid2" }, 519 {{ -1, 0xB4, 0x52, 0xCD }, "mediumorchid3" }, 520 {{ -1, 0x7A, 0x37, 0x8B }, "mediumorchid4" }, 521 {{ -1, 0x93, 0x70, 0xDB }, "mediumpurple" }, 522 {{ -1, 0xAB, 0x82, 0xFF }, "mediumpurple1" }, 523 {{ -1, 0x9F, 0x79, 0xEE }, "mediumpurple2" }, 524 {{ -1, 0x89, 0x68, 0xCD }, "mediumpurple3" }, 525 {{ -1, 0x5D, 0x47, 0x8B }, "mediumpurple4" }, 526 {{ -1, 0x3C, 0xB3, 0x71 }, "mediumseagreen" }, 527 {{ -1, 0x7B, 0x68, 0xEE }, "mediumslateblue" }, 528 {{ -1, 0x00, 0xFA, 0x9A }, "mediumspringgreen" }, 529 {{ -1, 0x48, 0xD1, 0xCC }, "mediumturquoise" }, 530 {{ -1, 0xC7, 0x15, 0x85 }, "mediumvioletred" }, 531 {{ -1, 0x19, 0x19, 0x70 }, "midnightblue" }, 532 {{ -1, 0xF5, 0xFF, 0xFA }, "mintcream" }, 533 {{ -1, 0xFF, 0xE4, 0xE1 }, "mistyrose" }, 534 {{ -1, 0xFF, 0xE4, 0xE1 }, "mistyrose1" }, 535 {{ -1, 0xEE, 0xD5, 0xD2 }, "mistyrose2" }, 536 {{ -1, 0xCD, 0xB7, 0xB5 }, "mistyrose3" }, 537 {{ -1, 0x8B, 0x7D, 0x7B }, "mistyrose4" }, 538 {{ -1, 0xFF, 0xE4, 0xB5 }, "moccasin" }, 539 {{ -1, 0xFF, 0xDE, 0xAD }, "navajowhite" }, 540 {{ -1, 0xFF, 0xDE, 0xAD }, "navajowhite1" }, 541 {{ -1, 0xEE, 0xCF, 0xA1 }, "navajowhite2" }, 542 {{ -1, 0xCD, 0xB3, 0x8B }, "navajowhite3" }, 543 {{ -1, 0x8B, 0x79, 0x5E }, "navajowhite4" }, 544 {{ -1, 0x00, 0x00, 0x80 }, "navy" }, 545 {{ -1, 0x00, 0x00, 0x80 }, "navyblue" }, 546 {{ -1, 0xFD, 0xF5, 0xE6 }, "oldlace" }, 547 {{ -1, 0x80, 0x80, 0x00 }, "olive" }, 548 {{ -1, 0x6B, 0x8E, 0x23 }, "olivedrab" }, 549 {{ -1, 0xC0, 0xFF, 0x3E }, "olivedrab1" }, 550 {{ -1, 0xB3, 0xEE, 0x3A }, "olivedrab2" }, 551 {{ -1, 0x9A, 0xCD, 0x32 }, "olivedrab3" }, 552 {{ -1, 0x69, 0x8B, 0x22 }, "olivedrab4" }, 553 {{ -1, 0xFF, 0xA5, 0x00 }, "orange" }, 554 {{ -1, 0xFF, 0xA5, 0x00 }, "orange1" }, 555 {{ -1, 0xEE, 0x9A, 0x00 }, "orange2" }, 556 {{ -1, 0xCD, 0x85, 0x00 }, "orange3" }, 557 {{ -1, 0x8B, 0x5A, 0x00 }, "orange4" }, 558 {{ -1, 0xFF, 0x45, 0x00 }, "orangered" }, 559 {{ -1, 0xFF, 0x45, 0x00 }, "orangered1" }, 560 {{ -1, 0xEE, 0x40, 0x00 }, "orangered2" }, 561 {{ -1, 0xCD, 0x37, 0x00 }, "orangered3" }, 562 {{ -1, 0x8B, 0x25, 0x00 }, "orangered4" }, 563 {{ -1, 0xDA, 0x70, 0xD6 }, "orchid" }, 564 {{ -1, 0xFF, 0x83, 0xFA }, "orchid1" }, 565 {{ -1, 0xEE, 0x7A, 0xE9 }, "orchid2" }, 566 {{ -1, 0xCD, 0x69, 0xC9 }, "orchid3" }, 567 {{ -1, 0x8B, 0x47, 0x89 }, "orchid4" }, 568 {{ -1, 0xEE, 0xE8, 0xAA }, "palegoldenrod" }, 569 {{ -1, 0x98, 0xFB, 0x98 }, "palegreen" }, 570 {{ -1, 0x9A, 0xFF, 0x9A }, "palegreen1" }, 571 {{ -1, 0x90, 0xEE, 0x90 }, "palegreen2" }, 572 {{ -1, 0x7C, 0xCD, 0x7C }, "palegreen3" }, 573 {{ -1, 0x54, 0x8B, 0x54 }, "palegreen4" }, 574 {{ -1, 0xAF, 0xEE, 0xEE }, "paleturquoise" }, 575 {{ -1, 0xBB, 0xFF, 0xFF }, "paleturquoise1" }, 576 {{ -1, 0xAE, 0xEE, 0xEE }, "paleturquoise2" }, 577 {{ -1, 0x96, 0xCD, 0xCD }, "paleturquoise3" }, 578 {{ -1, 0x66, 0x8B, 0x8B }, "paleturquoise4" }, 579 {{ -1, 0xDB, 0x70, 0x93 }, "palevioletred" }, 580 {{ -1, 0xFF, 0x82, 0xAB }, "palevioletred1" }, 581 {{ -1, 0xEE, 0x79, 0x9F }, "palevioletred2" }, 582 {{ -1, 0xCD, 0x68, 0x89 }, "palevioletred3" }, 583 {{ -1, 0x8B, 0x47, 0x5D }, "palevioletred4" }, 584 {{ -1, 0xFF, 0xEF, 0xD5 }, "papayawhip" }, 585 {{ -1, 0xFF, 0xDA, 0xB9 }, "peachpuff" }, 586 {{ -1, 0xFF, 0xDA, 0xB9 }, "peachpuff1" }, 587 {{ -1, 0xEE, 0xCB, 0xAD }, "peachpuff2" }, 588 {{ -1, 0xCD, 0xAF, 0x95 }, "peachpuff3" }, 589 {{ -1, 0x8B, 0x77, 0x65 }, "peachpuff4" }, 590 {{ -1, 0xCD, 0x85, 0x3F }, "peru" }, 591 {{ -1, 0xFF, 0xC0, 0xCB }, "pink" }, 592 {{ -1, 0xFF, 0xB5, 0xC5 }, "pink1" }, 593 {{ -1, 0xEE, 0xA9, 0xB8 }, "pink2" }, 594 {{ -1, 0xCD, 0x91, 0x9E }, "pink3" }, 595 {{ -1, 0x8B, 0x63, 0x6C }, "pink4" }, 596 {{ -1, 0xDD, 0xA0, 0xDD }, "plum" }, 597 {{ -1, 0xFF, 0xBB, 0xFF }, "plum1" }, 598 {{ -1, 0xEE, 0xAE, 0xEE }, "plum2" }, 599 {{ -1, 0xCD, 0x96, 0xCD }, "plum3" }, 600 {{ -1, 0x8B, 0x66, 0x8B }, "plum4" }, 601 {{ -1, 0xB0, 0xE0, 0xE6 }, "powderblue" }, 602 {{ -1, 0xA0, 0x20, 0xF0 }, "purple" }, 603 {{ -1, 0x9B, 0x30, 0xFF }, "purple1" }, 604 {{ -1, 0x91, 0x2C, 0xEE }, "purple2" }, 605 {{ -1, 0x7D, 0x26, 0xCD }, "purple3" }, 606 {{ -1, 0x55, 0x1A, 0x8B }, "purple4" }, 607 {{ -1, 0x66, 0x33, 0x99 }, "rebeccapurple" }, 608 {{ -1, 0xFF, 0x00, 0x00 }, "red" }, 609 {{ -1, 0xFF, 0x00, 0x00 }, "red1" }, 610 {{ -1, 0xEE, 0x00, 0x00 }, "red2" }, 611 {{ -1, 0xCD, 0x00, 0x00 }, "red3" }, 612 {{ -1, 0x8B, 0x00, 0x00 }, "red4" }, 613 {{ -1, 0xBC, 0x8F, 0x8F }, "rosybrown" }, 614 {{ -1, 0xFF, 0xC1, 0xC1 }, "rosybrown1" }, 615 {{ -1, 0xEE, 0xB4, 0xB4 }, "rosybrown2" }, 616 {{ -1, 0xCD, 0x9B, 0x9B }, "rosybrown3" }, 617 {{ -1, 0x8B, 0x69, 0x69 }, "rosybrown4" }, 618 {{ -1, 0x41, 0x69, 0xE1 }, "royalblue" }, 619 {{ -1, 0x48, 0x76, 0xFF }, "royalblue1" }, 620 {{ -1, 0x43, 0x6E, 0xEE }, "royalblue2" }, 621 {{ -1, 0x3A, 0x5F, 0xCD }, "royalblue3" }, 622 {{ -1, 0x27, 0x40, 0x8B }, "royalblue4" }, 623 {{ -1, 0x8B, 0x45, 0x13 }, "saddlebrown" }, 624 {{ -1, 0xFA, 0x80, 0x72 }, "salmon" }, 625 {{ -1, 0xFF, 0x8C, 0x69 }, "salmon1" }, 626 {{ -1, 0xEE, 0x82, 0x62 }, "salmon2" }, 627 {{ -1, 0xCD, 0x70, 0x54 }, "salmon3" }, 628 {{ -1, 0x8B, 0x4C, 0x39 }, "salmon4" }, 629 {{ -1, 0xF4, 0xA4, 0x60 }, "sandybrown" }, 630 {{ -1, 0x2E, 0x8B, 0x57 }, "seagreen" }, 631 {{ -1, 0x54, 0xFF, 0x9F }, "seagreen1" }, 632 {{ -1, 0x4E, 0xEE, 0x94 }, "seagreen2" }, 633 {{ -1, 0x43, 0xCD, 0x80 }, "seagreen3" }, 634 {{ -1, 0x2E, 0x8B, 0x57 }, "seagreen4" }, 635 {{ -1, 0xFF, 0xF5, 0xEE }, "seashell" }, 636 {{ -1, 0xFF, 0xF5, 0xEE }, "seashell1" }, 637 {{ -1, 0xEE, 0xE5, 0xDE }, "seashell2" }, 638 {{ -1, 0xCD, 0xC5, 0xBF }, "seashell3" }, 639 {{ -1, 0x8B, 0x86, 0x82 }, "seashell4" }, 640 {{ -1, 0xA0, 0x52, 0x2D }, "sienna" }, 641 {{ -1, 0xFF, 0x82, 0x47 }, "sienna1" }, 642 {{ -1, 0xEE, 0x79, 0x42 }, "sienna2" }, 643 {{ -1, 0xCD, 0x68, 0x39 }, "sienna3" }, 644 {{ -1, 0x8B, 0x47, 0x26 }, "sienna4" }, 645 {{ -1, 0xC0, 0xC0, 0xC0 }, "silver" }, 646 {{ -1, 0x87, 0xCE, 0xEB }, "skyblue" }, 647 {{ -1, 0x87, 0xCE, 0xFF }, "skyblue1" }, 648 {{ -1, 0x7E, 0xC0, 0xEE }, "skyblue2" }, 649 {{ -1, 0x6C, 0xA6, 0xCD }, "skyblue3" }, 650 {{ -1, 0x4A, 0x70, 0x8B }, "skyblue4" }, 651 {{ -1, 0x6A, 0x5A, 0xCD }, "slateblue" }, 652 {{ -1, 0x83, 0x6F, 0xFF }, "slateblue1" }, 653 {{ -1, 0x7A, 0x67, 0xEE }, "slateblue2" }, 654 {{ -1, 0x69, 0x59, 0xCD }, "slateblue3" }, 655 {{ -1, 0x47, 0x3C, 0x8B }, "slateblue4" }, 656 {{ -1, 0x70, 0x80, 0x90 }, "slategray" }, 657 {{ -1, 0xC6, 0xE2, 0xFF }, "slategray1" }, 658 {{ -1, 0xB9, 0xD3, 0xEE }, "slategray2" }, 659 {{ -1, 0x9F, 0xB6, 0xCD }, "slategray3" }, 660 {{ -1, 0x6C, 0x7B, 0x8B }, "slategray4" }, 661 {{ -1, 0x70, 0x80, 0x90 }, "slategrey" }, 662 {{ -1, 0xFF, 0xFA, 0xFA }, "snow" }, 663 {{ -1, 0xFF, 0xFA, 0xFA }, "snow1" }, 664 {{ -1, 0xEE, 0xE9, 0xE9 }, "snow2" }, 665 {{ -1, 0xCD, 0xC9, 0xC9 }, "snow3" }, 666 {{ -1, 0x8B, 0x89, 0x89 }, "snow4" }, 667 {{ -1, 0x00, 0xFF, 0x7F }, "springgreen" }, 668 {{ -1, 0x00, 0xFF, 0x7F }, "springgreen1" }, 669 {{ -1, 0x00, 0xEE, 0x76 }, "springgreen2" }, 670 {{ -1, 0x00, 0xCD, 0x66 }, "springgreen3" }, 671 {{ -1, 0x00, 0x8B, 0x45 }, "springgreen4" }, 672 {{ -1, 0x46, 0x82, 0xB4 }, "steelblue" }, 673 {{ -1, 0x63, 0xB8, 0xFF }, "steelblue1" }, 674 {{ -1, 0x5C, 0xAC, 0xEE }, "steelblue2" }, 675 {{ -1, 0x4F, 0x94, 0xCD }, "steelblue3" }, 676 {{ -1, 0x36, 0x64, 0x8B }, "steelblue4" }, 677 {{ -1, 0xD2, 0xB4, 0x8C }, "tan" }, 678 {{ -1, 0xFF, 0xA5, 0x4F }, "tan1" }, 679 {{ -1, 0xEE, 0x9A, 0x49 }, "tan2" }, 680 {{ -1, 0xCD, 0x85, 0x3F }, "tan3" }, 681 {{ -1, 0x8B, 0x5A, 0x2B }, "tan4" }, 682 {{ -1, 0x00, 0x80, 0x80 }, "teal" }, 683 {{ -1, 0xD8, 0xBF, 0xD8 }, "thistle" }, 684 {{ -1, 0xFF, 0xE1, 0xFF }, "thistle1" }, 685 {{ -1, 0xEE, 0xD2, 0xEE }, "thistle2" }, 686 {{ -1, 0xCD, 0xB5, 0xCD }, "thistle3" }, 687 {{ -1, 0x8B, 0x7B, 0x8B }, "thistle4" }, 688 {{ -1, 0xFF, 0x63, 0x47 }, "tomato" }, 689 {{ -1, 0xFF, 0x63, 0x47 }, "tomato1" }, 690 {{ -1, 0xEE, 0x5C, 0x42 }, "tomato2" }, 691 {{ -1, 0xCD, 0x4F, 0x39 }, "tomato3" }, 692 {{ -1, 0x8B, 0x36, 0x26 }, "tomato4" }, 693 {{ -1, 0x40, 0xE0, 0xD0 }, "turquoise" }, 694 {{ -1, 0x00, 0xF5, 0xFF }, "turquoise1" }, 695 {{ -1, 0x00, 0xE5, 0xEE }, "turquoise2" }, 696 {{ -1, 0x00, 0xC5, 0xCD }, "turquoise3" }, 697 {{ -1, 0x00, 0x86, 0x8B }, "turquoise4" }, 698 {{ -1, 0xEE, 0x82, 0xEE }, "violet" }, 699 {{ -1, 0xD0, 0x20, 0x90 }, "violetred" }, 700 {{ -1, 0xFF, 0x3E, 0x96 }, "violetred1" }, 701 {{ -1, 0xEE, 0x3A, 0x8C }, "violetred2" }, 702 {{ -1, 0xCD, 0x32, 0x78 }, "violetred3" }, 703 {{ -1, 0x8B, 0x22, 0x52 }, "violetred4" }, 704 {{ -1, 0x80, 0x80, 0x80 }, "webgray" }, 705 {{ -1, 0x00, 0x80, 0x00 }, "webgreen" }, 706 {{ -1, 0x80, 0x80, 0x80 }, "webgrey" }, 707 {{ -1, 0x80, 0x00, 0x00 }, "webmaroon" }, 708 {{ -1, 0x80, 0x00, 0x80 }, "webpurple" }, 709 {{ -1, 0xF5, 0xDE, 0xB3 }, "wheat" }, 710 {{ -1, 0xFF, 0xE7, 0xBA }, "wheat1" }, 711 {{ -1, 0xEE, 0xD8, 0xAE }, "wheat2" }, 712 {{ -1, 0xCD, 0xBA, 0x96 }, "wheat3" }, 713 {{ -1, 0x8B, 0x7E, 0x66 }, "wheat4" }, 714 {{ -1, 0xFF, 0xFF, 0xFF }, "white" }, 715 {{ -1, 0xF5, 0xF5, 0xF5 }, "whitesmoke" }, 716 {{ -1, 0xBE, 0xBE, 0xBE }, "x11gray" }, 717 {{ -1, 0x00, 0xFF, 0x00 }, "x11green" }, 718 {{ -1, 0xBE, 0xBE, 0xBE }, "x11grey" }, 719 {{ -1, 0xB0, 0x30, 0x60 }, "x11maroon" }, 720 {{ -1, 0xA0, 0x20, 0xF0 }, "x11purple" }, 721 {{ -1, 0xFF, 0xFF, 0x00 }, "yellow" }, 722 {{ -1, 0xFF, 0xFF, 0x00 }, "yellow1" }, 723 {{ -1, 0xEE, 0xEE, 0x00 }, "yellow2" }, 724 {{ -1, 0xCD, 0xCD, 0x00 }, "yellow3" }, 725 {{ -1, 0x8B, 0x8B, 0x00 }, "yellow4" }, 726 {{ -1, 0x9A, 0xCD, 0x32 }, "yellowgreen" } 727 728}; 729 730/** 731 * The number of elements within the GUAC_TERMINAL_NAMED_COLORS array. 732 */ 733#define GUAC_TERMINAL_NAMED_COLORS_LENGTH \ 734 (sizeof(GUAC_TERMINAL_NAMED_COLORS) / sizeof(guac_terminal_named_color)) 735 736/** 737 * Compares the string search key given to bsearch() with the name of a 738 * guac_terminal_named_color, ignoring case and whitespace. 739 * 740 * @param a 741 * A pointer to a string containing the search key (color name). 742 * 743 * @param b 744 * A pointer to a guac_terminal_named_color structure whose name should be 745 * compared against the search key. 746 * 747 * @returns 748 * Zero if the search key and color name are identical, a negative value if 749 * the search key sorts before the color name, or a positive value if the 750 * search key sorts after the color name. 751 */ 752static int guac_terminal_named_color_search(const void* a, const void* b) { 753 754 const char* key = (const char*) a; 755 const char* name = ((const guac_terminal_named_color*) b)->name; 756 757 /* For each corresponding character pair in each string */ 758 for (; *key && *name; key++, name++) { 759 760 /* Skip any spaces in key (name will never have spaces) */ 761 while (*key && isspace(*key)) key++; 762 763 /* Treat semi-colon as string terminator, to support parsing color 764 names within a larger string (e.g. within the terminal color-scheme 765 configuration string). */ 766 const int keyChar = (*key == ';') ? '\0' : tolower(*key); 767 768 /* Compare, ignoring case (name is already known to be lowercase) */ 769 int difference = keyChar - *name; 770 if (difference) 771 return difference; 772 773 } 774 775 /* If we haven't reached the end of name yet, key is shorter */ 776 if (*name) 777 return -1; 778 779 /* The strings are identical */ 780 return 0; 781 782} 783 784int guac_terminal_find_color(const char* name, guac_terminal_color* color) { 785 786 /* Search for the color having the given name */ 787 guac_terminal_named_color* found = bsearch(name, 788 GUAC_TERMINAL_NAMED_COLORS, GUAC_TERMINAL_NAMED_COLORS_LENGTH, 789 sizeof(guac_terminal_named_color), 790 guac_terminal_named_color_search); 791 792 /* Fail if no such color is found */ 793 if (found == NULL) 794 return 1; 795 796 /* Otherwise copy the found color */ 797 *color = found->color; 798 return 0; 799 800} 801