Module colour
[hide private]
[frames] | no frames]

Source Code for Module colour

   1  ############################################################################### 
   2  #                                                                             # 
   3  # Copyright (C) 2006 Edward d'Auvergne                                        # 
   4  #                                                                             # 
   5  # This file is part of the program relax.                                     # 
   6  #                                                                             # 
   7  # relax is free software; you can redistribute it and/or modify               # 
   8  # it under the terms of the GNU General Public License as published by        # 
   9  # the Free Software Foundation; either version 2 of the License, or           # 
  10  # (at your option) any later version.                                         # 
  11  #                                                                             # 
  12  # relax is distributed in the hope that it will be useful,                    # 
  13  # but WITHOUT ANY WARRANTY; without even the implied warranty of              # 
  14  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               # 
  15  # GNU General Public License for more details.                                # 
  16  #                                                                             # 
  17  # You should have received a copy of the GNU General Public License           # 
  18  # along with relax; if not, write to the Free Software                        # 
  19  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA   # 
  20  #                                                                             # 
  21  ############################################################################### 
  22   
  23  from Numeric import Float64, array 
  24   
  25   
26 -class Colour:
27 - def __init__(self):
28 """Class for all functions relating to colour."""
29 30
31 - def linear_gradient(self, value, start, end, colour_list=None):
32 """Return an RGB colour array of the value placed on a linear colour gradient. 33 34 The argment value should be a number between zero and one. The start and end colours can 35 either be strings or RGB colour arrays. 36 """ 37 38 # Translate the end colour to RGB arrays if necessary. 39 if type(start) == str: 40 # Default (search the molmol list then the X11 list). 41 if colour_list == None: 42 try: 43 start = self.molmol_colours(start) 44 except: 45 start = self.x11_colours(start) 46 47 # Molmol colours. 48 elif colour_list == 'molmol': 49 start = self.molmol_colours(start) 50 51 # X11 colours. 52 elif colour_list == 'x11': 53 start = self.x11_colours(start) 54 55 # Translate the end colour to RGB arrays if necessary. 56 if type(end) == str: 57 # Default (search the molmol list then the X11 list). 58 if colour_list == None: 59 try: 60 end = self.molmol_colours(end) 61 except: 62 end = self.x11_colours(end) 63 64 # Molmol colours. 65 elif colour_list == 'molmol': 66 end = self.molmol_colours(end) 67 68 # X11 colours. 69 elif colour_list == 'x11': 70 end = self.x11_colours(end) 71 72 # Truncate the value to be between zero and one. 73 if value < 0.0: 74 value = 0.0 75 elif value > 1.0: 76 value = 1.0 77 78 # The position on the linear gradient. 79 return value * (end - start) + start
80 81
82 - def molmol_colours(self, name):
83 """ 84 Molmol RGB colour arrays 85 ~~~~~~~~~~~~~~~~~~~~~~~~ 86 87 The following table is a list of colours used in Molmol and their corresponding RGB colour 88 values ranging from 0 to 1. 89 _______________________________________________________________ 90 | | | | | 91 | Name | Red | Green | Blue | 92 |_______________________________|_________|_________|_________| 93 | | | | | 94 | 'black' | 0.000 | 0.000 | 0.000 | 95 | 'navy' | 0.000 | 0.000 | 0.502 | 96 | 'blue' | 0.000 | 0.000 | 1.000 | 97 | 'dark green' | 0.000 | 0.392 | 0.000 | 98 | 'green' | 0.000 | 1.000 | 0.000 | 99 | 'cyan' | 0.000 | 1.000 | 1.000 | 100 | 'turquoise' | 0.251 | 0.878 | 0.816 | 101 | 'royal blue' | 0.255 | 0.412 | 0.882 | 102 | 'aquamarine' | 0.498 | 1.000 | 0.831 | 103 | 'sky green' | 0.529 | 0.808 | 0.922 | 104 | 'dark violet' | 0.580 | 0.000 | 0.827 | 105 | 'pale green' | 0.596 | 0.984 | 0.596 | 106 | 'purple' | 0.627 | 0.125 | 0.941 | 107 | 'brown' | 0.647 | 0.165 | 0.165 | 108 | 'light blue' | 0.678 | 0.847 | 0.902 | 109 | 'grey' | 0.745 | 0.745 | 0.745 | 110 | 'light grey' | 0.827 | 0.827 | 0.827 | 111 | 'violet' | 0.933 | 0.510 | 0.933 | 112 | 'light coral' | 0.941 | 0.502 | 0.502 | 113 | 'khaki' | 0.941 | 0.902 | 0.549 | 114 | 'beige' | 0.961 | 0.961 | 0.863 | 115 | 'red' | 1.000 | 0.000 | 0.000 | 116 | 'magenta' | 1.000 | 0.000 | 1.000 | 117 | 'deep pink' | 1.000 | 0.078 | 0.576 | 118 | 'orange red' | 1.000 | 0.271 | 0.000 | 119 | 'hot pink' | 1.000 | 0.412 | 0.706 | 120 | 'coral' | 1.000 | 0.498 | 0.314 | 121 | 'dark orange' | 1.000 | 0.549 | 0.000 | 122 | 'orange' | 1.000 | 0.647 | 0.000 | 123 | 'pink' | 1.000 | 0.753 | 0.796 | 124 | 'gold' | 1.000 | 0.843 | 0.000 | 125 | 'yellow' | 1.000 | 1.000 | 0.000 | 126 | 'light yellow' | 1.000 | 1.000 | 0.878 | 127 | 'ivory' | 1.000 | 1.000 | 0.941 | 128 | 'white' | 1.000 | 1.000 | 1.000 | 129 |_______________________________|_________|_________|_________| 130 131 """ 132 133 # Initialise the dictionary of colours. 134 colours = {} 135 136 # The colours sorted by the RGB float values. 137 colours['black'] = [0.000, 0.000, 0.000] 138 colours['navy'] = [0.000, 0.000, 0.502] 139 colours['blue'] = [0.000, 0.000, 1.000] 140 colours['dark green'] = [0.000, 0.392, 0.000] 141 colours['green'] = [0.000, 1.000, 0.000] 142 colours['cyan'] = [0.000, 1.000, 1.000] 143 colours['turquoise'] = [0.251, 0.878, 0.816] 144 colours['royal blue'] = [0.255, 0.412, 0.882] 145 colours['aquamarine'] = [0.498, 1.000, 0.831] 146 colours['sky green'] = [0.529, 0.808, 0.922] 147 colours['dark violet'] = [0.580, 0.000, 0.827] 148 colours['pale green'] = [0.596, 0.984, 0.596] 149 colours['purple'] = [0.627, 0.125, 0.941] 150 colours['brown'] = [0.647, 0.165, 0.165] 151 colours['light blue'] = [0.678, 0.847, 0.902] 152 colours['grey'] = [0.745, 0.745, 0.745] 153 colours['light grey'] = [0.827, 0.827, 0.827] 154 colours['violet'] = [0.933, 0.510, 0.933] 155 colours['light coral'] = [0.941, 0.502, 0.502] 156 colours['khaki'] = [0.941, 0.902, 0.549] 157 colours['beige'] = [0.961, 0.961, 0.863] 158 colours['red'] = [1.000, 0.000, 0.000] 159 colours['magenta'] = [1.000, 0.000, 1.000] 160 colours['deep pink'] = [1.000, 0.078, 0.576] 161 colours['orange red'] = [1.000, 0.271, 0.000] 162 colours['hot pink'] = [1.000, 0.412, 0.706] 163 colours['coral'] = [1.000, 0.498, 0.314] 164 colours['dark orange'] = [1.000, 0.549, 0.000] 165 colours['orange'] = [1.000, 0.647, 0.000] 166 colours['pink'] = [1.000, 0.753, 0.796] 167 colours['gold'] = [1.000, 0.843, 0.000] 168 colours['yellow'] = [1.000, 1.000, 0.000] 169 colours['light yellow'] = [1.000, 1.000, 0.878] 170 colours['ivory'] = [1.000, 1.000, 0.941] 171 colours['white'] = [1.000, 1.000, 1.000] 172 173 # Convert to Numeric arrays. 174 for key in colours: 175 colours[key] = array(colours[key], Float64) 176 177 # Invalid colour string. 178 if not colours.has_key(name): 179 raise RelaxInvalidColourError, name 180 181 # Return the RGB colour array. 182 return colours[name]
183 184
185 - def x11_colours(self, name):
186 """ 187 X11 RGB colour arrays 188 ~~~~~~~~~~~~~~~~~~~~~ 189 190 The following table is the list of X11 colour names and their corresponding RGB colour 191 values ranging from 0 to 255. 192 _______________________________________________________________ 193 | | | | | 194 | Name | Red | Green | Blue | 195 |_______________________________|_________|_________|_________| 196 | | | | | 197 | snow | 255 | 250 | 250 | 198 | ghost white | 248 | 248 | 255 | 199 | white smoke | 245 | 245 | 245 | 200 | gainsboro | 220 | 220 | 220 | 201 | floral white | 255 | 250 | 240 | 202 | old lace | 253 | 245 | 230 | 203 | linen | 250 | 240 | 230 | 204 | antique white | 250 | 235 | 215 | 205 | papaya whip | 255 | 239 | 213 | 206 | blanched almond | 255 | 235 | 205 | 207 | bisque | 255 | 228 | 196 | 208 | peach puff | 255 | 218 | 185 | 209 | navajo white | 255 | 222 | 173 | 210 | moccasin | 255 | 228 | 181 | 211 | cornsilk | 255 | 248 | 220 | 212 | ivory | 255 | 255 | 240 | 213 | lemon chiffon | 255 | 250 | 205 | 214 | seashell | 255 | 245 | 238 | 215 | honeydew | 240 | 255 | 240 | 216 | mint cream | 245 | 255 | 250 | 217 | azure | 240 | 255 | 255 | 218 | alice blue | 240 | 248 | 255 | 219 | lavender | 230 | 230 | 250 | 220 | lavender blush | 255 | 240 | 245 | 221 | misty rose | 255 | 228 | 225 | 222 | white | 255 | 255 | 255 | 223 | black | 0 | 0 | 0 | 224 | dark slate grey | 47 | 79 | 79 | 225 | dim grey | 105 | 105 | 105 | 226 | slate grey | 112 | 128 | 144 | 227 | light slate grey | 119 | 136 | 153 | 228 | grey | 190 | 190 | 190 | 229 | light grey | 211 | 211 | 211 | 230 | midnight blue | 25 | 25 | 112 | 231 | navy | 0 | 0 | 128 | 232 | cornflower blue | 100 | 149 | 237 | 233 | dark slate blue | 72 | 61 | 139 | 234 | slate blue | 106 | 90 | 205 | 235 | medium slate blue | 123 | 104 | 238 | 236 | light slate blue | 132 | 112 | 255 | 237 | medium blue | 0 | 0 | 205 | 238 | royal blue | 65 | 105 | 225 | 239 | blue | 0 | 0 | 255 | 240 | dodger blue | 30 | 144 | 255 | 241 | deep sky blue | 0 | 191 | 255 | 242 | sky blue | 135 | 206 | 235 | 243 | light sky blue | 135 | 206 | 250 | 244 | steel blue | 70 | 130 | 180 | 245 | light steel blue | 176 | 196 | 222 | 246 | light blue | 173 | 216 | 230 | 247 | powder blue | 176 | 224 | 230 | 248 | pale turquoise | 175 | 238 | 238 | 249 | dark turquoise | 0 | 206 | 209 | 250 | medium turquoise | 72 | 209 | 204 | 251 | turquoise | 64 | 224 | 208 | 252 | cyan | 0 | 255 | 255 | 253 | light cyan | 224 | 255 | 255 | 254 | cadet blue | 95 | 158 | 160 | 255 | medium aquamarine | 102 | 205 | 170 | 256 | aquamarine | 127 | 255 | 212 | 257 | dark green | 0 | 100 | 0 | 258 | dark olive green | 85 | 107 | 47 | 259 | dark sea green | 143 | 188 | 143 | 260 | sea green | 46 | 139 | 87 | 261 | medium sea green | 60 | 179 | 113 | 262 | light sea green | 32 | 178 | 170 | 263 | pale green | 152 | 251 | 152 | 264 | spring green | 0 | 255 | 127 | 265 | lawn green | 124 | 252 | 0 | 266 | green | 0 | 255 | 0 | 267 | chartreuse | 127 | 255 | 0 | 268 | medium spring green | 0 | 250 | 154 | 269 | green yellow | 173 | 255 | 47 | 270 | lime green | 50 | 205 | 50 | 271 | yellow green | 154 | 205 | 50 | 272 | forest green | 34 | 139 | 34 | 273 | olive drab | 107 | 142 | 35 | 274 | dark khaki | 189 | 183 | 107 | 275 | khaki | 240 | 230 | 140 | 276 | pale goldenrod | 238 | 232 | 170 | 277 | light goldenrod yellow | 250 | 250 | 210 | 278 | light yellow | 255 | 255 | 224 | 279 | yellow | 255 | 255 | 0 | 280 | gold | 255 | 215 | 0 | 281 | light goldenrod | 238 | 221 | 130 | 282 | goldenrod | 218 | 165 | 32 | 283 | dark goldenrod | 184 | 134 | 11 | 284 | rosy brown | 188 | 143 | 143 | 285 | indian red | 205 | 92 | 92 | 286 | saddle brown | 139 | 69 | 19 | 287 | sienna | 160 | 82 | 45 | 288 | peru | 205 | 133 | 63 | 289 | burlywood | 222 | 184 | 135 | 290 | beige | 245 | 245 | 220 | 291 | wheat | 245 | 222 | 179 | 292 | sandy brown | 244 | 164 | 96 | 293 | tan | 210 | 180 | 140 | 294 | chocolate | 210 | 105 | 30 | 295 | firebrick | 178 | 34 | 34 | 296 | brown | 165 | 42 | 42 | 297 | dark salmon | 233 | 150 | 122 | 298 | salmon | 250 | 128 | 114 | 299 | light salmon | 255 | 160 | 122 | 300 | orange | 255 | 165 | 0 | 301 | dark orange | 255 | 140 | 0 | 302 | coral | 255 | 127 | 80 | 303 | light coral | 240 | 128 | 128 | 304 | tomato | 255 | 99 | 71 | 305 | orange red | 255 | 69 | 0 | 306 | red | 255 | 0 | 0 | 307 | hot pink | 255 | 105 | 180 | 308 | deep pink | 255 | 20 | 147 | 309 | pink | 255 | 192 | 203 | 310 | light pink | 255 | 182 | 193 | 311 | pale violet red | 219 | 112 | 147 | 312 | maroon | 176 | 48 | 96 | 313 | medium violet red | 199 | 21 | 133 | 314 | violet red | 208 | 32 | 144 | 315 | magenta | 255 | 0 | 255 | 316 | violet | 238 | 130 | 238 | 317 | plum | 221 | 160 | 221 | 318 | orchid | 218 | 112 | 214 | 319 | medium orchid | 186 | 85 | 211 | 320 | dark orchid | 153 | 50 | 204 | 321 | dark violet | 148 | 0 | 211 | 322 | blue violet | 138 | 43 | 226 | 323 | purple | 160 | 32 | 240 | 324 | medium purple | 147 | 112 | 219 | 325 | thistle | 216 | 191 | 216 | 326 | snow 1 | 255 | 250 | 250 | 327 | snow 2 | 238 | 233 | 233 | 328 | snow 3 | 205 | 201 | 201 | 329 | snow 4 | 139 | 137 | 137 | 330 | seashell 1 | 255 | 245 | 238 | 331 | seashell 2 | 238 | 229 | 222 | 332 | seashell 3 | 205 | 197 | 191 | 333 | seashell 4 | 139 | 134 | 130 | 334 | antique white 1 | 255 | 239 | 219 | 335 | antique white 2 | 238 | 223 | 204 | 336 | antique white 3 | 205 | 192 | 176 | 337 | antique white 4 | 139 | 131 | 120 | 338 | bisque 1 | 255 | 228 | 196 | 339 | bisque 2 | 238 | 213 | 183 | 340 | bisque 3 | 205 | 183 | 158 | 341 | bisque 4 | 139 | 125 | 107 | 342 | peach puff 1 | 255 | 218 | 185 | 343 | peach puff 2 | 238 | 203 | 173 | 344 | peach puff 3 | 205 | 175 | 149 | 345 | peach puff 4 | 139 | 119 | 101 | 346 | navajo white 1 | 255 | 222 | 173 | 347 | navajo white 2 | 238 | 207 | 161 | 348 | navajo white 3 | 205 | 179 | 139 | 349 | navajo white 4 | 139 | 121 | 94 | 350 | lemon chiffon 1 | 255 | 250 | 205 | 351 | lemon chiffon 2 | 238 | 233 | 191 | 352 | lemon chiffon 3 | 205 | 201 | 165 | 353 | lemon chiffon 4 | 139 | 137 | 112 | 354 | cornsilk 1 | 255 | 248 | 220 | 355 | cornsilk 2 | 238 | 232 | 205 | 356 | cornsilk 3 | 205 | 200 | 177 | 357 | cornsilk 4 | 139 | 136 | 120 | 358 | ivory 1 | 255 | 255 | 240 | 359 | ivory 2 | 238 | 238 | 224 | 360 | ivory 3 | 205 | 205 | 193 | 361 | ivory 4 | 139 | 139 | 131 | 362 | honeydew 1 | 240 | 255 | 240 | 363 | honeydew 2 | 224 | 238 | 224 | 364 | honeydew 3 | 193 | 205 | 193 | 365 | honeydew 4 | 131 | 139 | 131 | 366 | lavender blush 1 | 255 | 240 | 245 | 367 | lavender blush 2 | 238 | 224 | 229 | 368 | lavender blush 3 | 205 | 193 | 197 | 369 | lavender blush 4 | 139 | 131 | 134 | 370 | misty rose 1 | 255 | 228 | 225 | 371 | misty rose 2 | 238 | 213 | 210 | 372 | misty rose 3 | 205 | 183 | 181 | 373 | misty rose 4 | 139 | 125 | 123 | 374 | azure 1 | 240 | 255 | 255 | 375 | azure 2 | 224 | 238 | 238 | 376 | azure 3 | 193 | 205 | 205 | 377 | azure 4 | 131 | 139 | 139 | 378 | slate blue 1 | 131 | 111 | 255 | 379 | slate blue 2 | 122 | 103 | 238 | 380 | slate blue 3 | 105 | 89 | 205 | 381 | slate blue 4 | 71 | 60 | 139 | 382 | royal blue 1 | 72 | 118 | 255 | 383 | royal blue 2 | 67 | 110 | 238 | 384 | royal blue 3 | 58 | 95 | 205 | 385 | royal blue 4 | 39 | 64 | 139 | 386 | blue 1 | 0 | 0 | 255 | 387 | blue 2 | 0 | 0 | 238 | 388 | blue 3 | 0 | 0 | 205 | 389 | blue 4 | 0 | 0 | 139 | 390 | dodger blue 1 | 30 | 144 | 255 | 391 | dodger blue 2 | 28 | 134 | 238 | 392 | dodger blue 3 | 24 | 116 | 205 | 393 | dodger blue 4 | 16 | 78 | 139 | 394 | steel blue 1 | 99 | 184 | 255 | 395 | steel blue 2 | 92 | 172 | 238 | 396 | steel blue 3 | 79 | 148 | 205 | 397 | steel blue 4 | 54 | 100 | 139 | 398 | deep sky blue 1 | 0 | 191 | 255 | 399 | deep sky blue 2 | 0 | 178 | 238 | 400 | deep sky blue 3 | 0 | 154 | 205 | 401 | deep sky blue 4 | 0 | 104 | 139 | 402 | sky blue 1 | 135 | 206 | 255 | 403 | sky blue 2 | 126 | 192 | 238 | 404 | sky blue 3 | 108 | 166 | 205 | 405 | sky blue 4 | 74 | 112 | 139 | 406 | light sky blue 1 | 176 | 226 | 255 | 407 | light sky blue 2 | 164 | 211 | 238 | 408 | light sky blue 3 | 141 | 182 | 205 | 409 | light sky blue 4 | 96 | 123 | 139 | 410 | slate grey 1 | 198 | 226 | 255 | 411 | slate grey 2 | 185 | 211 | 238 | 412 | slate grey 3 | 159 | 182 | 205 | 413 | slate grey 4 | 108 | 123 | 139 | 414 | light steel blue 1 | 202 | 225 | 255 | 415 | light steel blue 2 | 188 | 210 | 238 | 416 | light steel blue 3 | 162 | 181 | 205 | 417 | light steel blue 4 | 110 | 123 | 139 | 418 | light blue 1 | 191 | 239 | 255 | 419 | light blue 2 | 178 | 223 | 238 | 420 | light blue 3 | 154 | 192 | 205 | 421 | light blue 4 | 104 | 131 | 139 | 422 | light cyan 1 | 224 | 255 | 255 | 423 | light cyan 2 | 209 | 238 | 238 | 424 | light cyan 3 | 180 | 205 | 205 | 425 | light cyan 4 | 122 | 139 | 139 | 426 | pale turquoise 1 | 187 | 255 | 255 | 427 | pale turquoise 2 | 174 | 238 | 238 | 428 | pale turquoise 3 | 150 | 205 | 205 | 429 | pale turquoise 4 | 102 | 139 | 139 | 430 | cadet blue 1 | 152 | 245 | 255 | 431 | cadet blue 2 | 142 | 229 | 238 | 432 | cadet blue 3 | 122 | 197 | 205 | 433 | cadet blue 4 | 83 | 134 | 139 | 434 | turquoise 1 | 0 | 245 | 255 | 435 | turquoise 2 | 0 | 229 | 238 | 436 | turquoise 3 | 0 | 197 | 205 | 437 | turquoise 4 | 0 | 134 | 139 | 438 | cyan 1 | 0 | 255 | 255 | 439 | cyan 2 | 0 | 238 | 238 | 440 | cyan 3 | 0 | 205 | 205 | 441 | cyan 4 | 0 | 139 | 139 | 442 | dark slate grey 1 | 151 | 255 | 255 | 443 | dark slate grey 2 | 141 | 238 | 238 | 444 | dark slate grey 3 | 121 | 205 | 205 | 445 | dark slate grey 4 | 82 | 139 | 139 | 446 | aquamarine 1 | 127 | 255 | 212 | 447 | aquamarine 2 | 118 | 238 | 198 | 448 | aquamarine 3 | 102 | 205 | 170 | 449 | aquamarine 4 | 69 | 139 | 116 | 450 | dark sea green 1 | 193 | 255 | 193 | 451 | dark sea green 2 | 180 | 238 | 180 | 452 | dark sea green 3 | 155 | 205 | 155 | 453 | dark sea green 4 | 105 | 139 | 105 | 454 | sea green 1 | 84 | 255 | 159 | 455 | sea green 2 | 78 | 238 | 148 | 456 | sea green 3 | 67 | 205 | 128 | 457 | sea green 4 | 46 | 139 | 87 | 458 | pale green 1 | 154 | 255 | 154 | 459 | pale green 2 | 144 | 238 | 144 | 460 | pale green 3 | 124 | 205 | 124 | 461 | pale green 4 | 84 | 139 | 84 | 462 | spring green 1 | 0 | 255 | 127 | 463 | spring green 2 | 0 | 238 | 118 | 464 | spring green 3 | 0 | 205 | 102 | 465 | spring green 4 | 0 | 139 | 69 | 466 | green 1 | 0 | 255 | 0 | 467 | green 2 | 0 | 238 | 0 | 468 | green 3 | 0 | 205 | 0 | 469 | green 4 | 0 | 139 | 0 | 470 | chartreuse 1 | 127 | 255 | 0 | 471 | chartreuse 2 | 118 | 238 | 0 | 472 | chartreuse 3 | 102 | 205 | 0 | 473 | chartreuse 4 | 69 | 139 | 0 | 474 | olive drab 1 | 192 | 255 | 62 | 475 | olive drab 2 | 179 | 238 | 58 | 476 | olive drab 3 | 154 | 205 | 50 | 477 | olive drab 4 | 105 | 139 | 34 | 478 | dark olive green 1 | 202 | 255 | 112 | 479 | dark olive green 2 | 188 | 238 | 104 | 480 | dark olive green 3 | 162 | 205 | 90 | 481 | dark olive green 4 | 110 | 139 | 61 | 482 | khaki 1 | 255 | 246 | 143 | 483 | khaki 2 | 238 | 230 | 133 | 484 | khaki 3 | 205 | 198 | 115 | 485 | khaki 4 | 139 | 134 | 78 | 486 | light goldenrod 1 | 255 | 236 | 139 | 487 | light goldenrod 2 | 238 | 220 | 130 | 488 | light goldenrod 3 | 205 | 190 | 112 | 489 | light goldenrod 4 | 139 | 129 | 76 | 490 | light yellow 1 | 255 | 255 | 224 | 491 | light yellow 2 | 238 | 238 | 209 | 492 | light yellow 3 | 205 | 205 | 180 | 493 | light yellow 4 | 139 | 139 | 122 | 494 | yellow 1 | 255 | 255 | 0 | 495 | yellow 2 | 238 | 238 | 0 | 496 | yellow 3 | 205 | 205 | 0 | 497 | yellow 4 | 139 | 139 | 0 | 498 | gold 1 | 255 | 215 | 0 | 499 | gold 2 | 238 | 201 | 0 | 500 | gold 3 | 205 | 173 | 0 | 501 | gold 4 | 139 | 117 | 0 | 502 | goldenrod 1 | 255 | 193 | 37 | 503 | goldenrod 2 | 238 | 180 | 34 | 504 | goldenrod 3 | 205 | 155 | 29 | 505 | goldenrod 4 | 139 | 105 | 20 | 506 | dark goldenrod 1 | 255 | 185 | 15 | 507 | dark goldenrod 2 | 238 | 173 | 14 | 508 | dark goldenrod 3 | 205 | 149 | 12 | 509 | dark goldenrod 4 | 139 | 101 | 8 | 510 | rosy brown 1 | 255 | 193 | 193 | 511 | rosy brown 2 | 238 | 180 | 180 | 512 | rosy brown 3 | 205 | 155 | 155 | 513 | rosy brown 4 | 139 | 105 | 105 | 514 | indian red 1 | 255 | 106 | 106 | 515 | indian red 2 | 238 | 99 | 99 | 516 | indian red 3 | 205 | 85 | 85 | 517 | indian red 4 | 139 | 58 | 58 | 518 | sienna 1 | 255 | 130 | 71 | 519 | sienna 2 | 238 | 121 | 66 | 520 | sienna 3 | 205 | 104 | 57 | 521 | sienna 4 | 139 | 71 | 38 | 522 | burlywood 1 | 255 | 211 | 155 | 523 | burlywood 2 | 238 | 197 | 145 | 524 | burlywood 3 | 205 | 170 | 125 | 525 | burlywood 4 | 139 | 115 | 85 | 526 | wheat 1 | 255 | 231 | 186 | 527 | wheat 2 | 238 | 216 | 174 | 528 | wheat 3 | 205 | 186 | 150 | 529 | wheat 4 | 139 | 126 | 102 | 530 | tan 1 | 255 | 165 | 79 | 531 | tan 2 | 238 | 154 | 73 | 532 | tan 3 | 205 | 133 | 63 | 533 | tan 4 | 139 | 90 | 43 | 534 | chocolate 1 | 255 | 127 | 36 | 535 | chocolate 2 | 238 | 118 | 33 | 536 | chocolate 3 | 205 | 102 | 29 | 537 | chocolate 4 | 139 | 69 | 19 | 538 | firebrick 1 | 255 | 48 | 48 | 539 | firebrick 2 | 238 | 44 | 44 | 540 | firebrick 3 | 205 | 38 | 38 | 541 | firebrick 4 | 139 | 26 | 26 | 542 | brown 1 | 255 | 64 | 64 | 543 | brown 2 | 238 | 59 | 59 | 544 | brown 3 | 205 | 51 | 51 | 545 | brown 4 | 139 | 35 | 35 | 546 | salmon 1 | 255 | 140 | 105 | 547 | salmon 2 | 238 | 130 | 98 | 548 | salmon 3 | 205 | 112 | 84 | 549 | salmon 4 | 139 | 76 | 57 | 550 | light salmon 1 | 255 | 160 | 122 | 551 | light salmon 2 | 238 | 149 | 114 | 552 | light salmon 3 | 205 | 129 | 98 | 553 | light salmon 4 | 139 | 87 | 66 | 554 | orange 1 | 255 | 165 | 0 | 555 | orange 2 | 238 | 154 | 0 | 556 | orange 3 | 205 | 133 | 0 | 557 | orange 4 | 139 | 90 | 0 | 558 | dark orange 1 | 255 | 127 | 0 | 559 | dark orange 2 | 238 | 118 | 0 | 560 | dark orange 3 | 205 | 102 | 0 | 561 | dark orange 4 | 139 | 69 | 0 | 562 | coral 1 | 255 | 114 | 86 | 563 | coral 2 | 238 | 106 | 80 | 564 | coral 3 | 205 | 91 | 69 | 565 | coral 4 | 139 | 62 | 47 | 566 | tomato 1 | 255 | 99 | 71 | 567 | tomato 2 | 238 | 92 | 66 | 568 | tomato 3 | 205 | 79 | 57 | 569 | tomato 4 | 139 | 54 | 38 | 570 | orange red 1 | 255 | 69 | 0 | 571 | orange red 2 | 238 | 64 | 0 | 572 | orange red 3 | 205 | 55 | 0 | 573 | orange red 4 | 139 | 37 | 0 | 574 | red 1 | 255 | 0 | 0 | 575 | red 2 | 238 | 0 | 0 | 576 | red 3 | 205 | 0 | 0 | 577 | red 4 | 139 | 0 | 0 | 578 | deep pink 1 | 255 | 20 | 147 | 579 | deep pink 2 | 238 | 18 | 137 | 580 | deep pink 3 | 205 | 16 | 118 | 581 | deep pink 4 | 139 | 10 | 80 | 582 | hot pink 1 | 255 | 110 | 180 | 583 | hot pink 2 | 238 | 106 | 167 | 584 | hot pink 3 | 205 | 96 | 144 | 585 | hot pink 4 | 139 | 58 | 98 | 586 | pink 1 | 255 | 181 | 197 | 587 | pink 2 | 238 | 169 | 184 | 588 | pink 3 | 205 | 145 | 158 | 589 | pink 4 | 139 | 99 | 108 | 590 | light pink 1 | 255 | 174 | 185 | 591 | light pink 2 | 238 | 162 | 173 | 592 | light pink 3 | 205 | 140 | 149 | 593 | light pink 4 | 139 | 95 | 101 | 594 | pale violet red 1 | 255 | 130 | 171 | 595 | pale violet red 2 | 238 | 121 | 159 | 596 | pale violet red 3 | 205 | 104 | 137 | 597 | pale violet red 4 | 139 | 71 | 93 | 598 | maroon 1 | 255 | 52 | 179 | 599 | maroon 2 | 238 | 48 | 167 | 600 | maroon 3 | 205 | 41 | 144 | 601 | maroon 4 | 139 | 28 | 98 | 602 | violet red 1 | 255 | 62 | 150 | 603 | violet red 2 | 238 | 58 | 140 | 604 | violet red 3 | 205 | 50 | 120 | 605 | violet red 4 | 139 | 34 | 82 | 606 | magenta 1 | 255 | 0 | 255 | 607 | magenta 2 | 238 | 0 | 238 | 608 | magenta 3 | 205 | 0 | 205 | 609 | magenta 4 | 139 | 0 | 139 | 610 | orchid 1 | 255 | 131 | 250 | 611 | orchid 2 | 238 | 122 | 233 | 612 | orchid 3 | 205 | 105 | 201 | 613 | orchid 4 | 139 | 71 | 137 | 614 | plum 1 | 255 | 187 | 255 | 615 | plum 2 | 238 | 174 | 238 | 616 | plum 3 | 205 | 150 | 205 | 617 | plum 4 | 139 | 102 | 139 | 618 | medium orchid 1 | 224 | 102 | 255 | 619 | medium orchid 2 | 209 | 95 | 238 | 620 | medium orchid 3 | 180 | 82 | 205 | 621 | medium orchid 4 | 122 | 55 | 139 | 622 | dark orchid 1 | 191 | 62 | 255 | 623 | dark orchid 2 | 178 | 58 | 238 | 624 | dark orchid 3 | 154 | 50 | 205 | 625 | dark orchid 4 | 104 | 34 | 139 | 626 | purple 1 | 155 | 48 | 255 | 627 | purple 2 | 145 | 44 | 238 | 628 | purple 3 | 125 | 38 | 205 | 629 | purple 4 | 85 | 26 | 139 | 630 | medium purple 1 | 171 | 130 | 255 | 631 | medium purple 2 | 159 | 121 | 238 | 632 | medium purple 3 | 137 | 104 | 205 | 633 | medium purple 4 | 93 | 71 | 139 | 634 | thistle 1 | 255 | 225 | 255 | 635 | thistle 2 | 238 | 210 | 238 | 636 | thistle 3 | 205 | 181 | 205 | 637 | thistle 4 | 139 | 123 | 139 | 638 | grey 0 | 0 | 0 | 0 | 639 | grey 1 | 3 | 3 | 3 | 640 | grey 2 | 5 | 5 | 5 | 641 | grey 3 | 8 | 8 | 8 | 642 | grey 4 | 10 | 10 | 10 | 643 | grey 5 | 13 | 13 | 13 | 644 | grey 6 | 15 | 15 | 15 | 645 | grey 7 | 18 | 18 | 18 | 646 | grey 8 | 20 | 20 | 20 | 647 | grey 9 | 23 | 23 | 23 | 648 | grey 10 | 26 | 26 | 26 | 649 | grey 11 | 28 | 28 | 28 | 650 | grey 12 | 31 | 31 | 31 | 651 | grey 13 | 33 | 33 | 33 | 652 | grey 14 | 36 | 36 | 36 | 653 | grey 15 | 38 | 38 | 38 | 654 | grey 16 | 41 | 41 | 41 | 655 | grey 17 | 43 | 43 | 43 | 656 | grey 18 | 46 | 46 | 46 | 657 | grey 19 | 48 | 48 | 48 | 658 | grey 20 | 51 | 51 | 51 | 659 | grey 21 | 54 | 54 | 54 | 660 | grey 22 | 56 | 56 | 56 | 661 | grey 23 | 59 | 59 | 59 | 662 | grey 24 | 61 | 61 | 61 | 663 | grey 25 | 64 | 64 | 64 | 664 | grey 26 | 66 | 66 | 66 | 665 | grey 27 | 69 | 69 | 69 | 666 | grey 28 | 71 | 71 | 71 | 667 | grey 29 | 74 | 74 | 74 | 668 | grey 30 | 77 | 77 | 77 | 669 | grey 31 | 79 | 79 | 79 | 670 | grey 32 | 82 | 82 | 82 | 671 | grey 33 | 84 | 84 | 84 | 672 | grey 34 | 87 | 87 | 87 | 673 | grey 35 | 89 | 89 | 89 | 674 | grey 36 | 92 | 92 | 92 | 675 | grey 37 | 94 | 94 | 94 | 676 | grey 38 | 97 | 97 | 97 | 677 | grey 39 | 99 | 99 | 99 | 678 | grey 40 | 102 | 102 | 102 | 679 | grey 41 | 105 | 105 | 105 | 680 | grey 42 | 107 | 107 | 107 | 681 | grey 43 | 110 | 110 | 110 | 682 | grey 44 | 112 | 112 | 112 | 683 | grey 45 | 115 | 115 | 115 | 684 | grey 46 | 117 | 117 | 117 | 685 | grey 47 | 120 | 120 | 120 | 686 | grey 48 | 122 | 122 | 122 | 687 | grey 49 | 125 | 125 | 125 | 688 | grey 50 | 127 | 127 | 127 | 689 | grey 51 | 130 | 130 | 130 | 690 | grey 52 | 133 | 133 | 133 | 691 | grey 53 | 135 | 135 | 135 | 692 | grey 54 | 138 | 138 | 138 | 693 | grey 55 | 140 | 140 | 140 | 694 | grey 56 | 143 | 143 | 143 | 695 | grey 57 | 145 | 145 | 145 | 696 | grey 58 | 148 | 148 | 148 | 697 | grey 59 | 150 | 150 | 150 | 698 | grey 60 | 153 | 153 | 153 | 699 | grey 61 | 156 | 156 | 156 | 700 | grey 62 | 158 | 158 | 158 | 701 | grey 63 | 161 | 161 | 161 | 702 | grey 64 | 163 | 163 | 163 | 703 | grey 65 | 166 | 166 | 166 | 704 | grey 66 | 168 | 168 | 168 | 705 | grey 67 | 171 | 171 | 171 | 706 | grey 68 | 173 | 173 | 173 | 707 | grey 69 | 176 | 176 | 176 | 708 | grey 70 | 179 | 179 | 179 | 709 | grey 71 | 181 | 181 | 181 | 710 | grey 72 | 184 | 184 | 184 | 711 | grey 73 | 186 | 186 | 186 | 712 | grey 74 | 189 | 189 | 189 | 713 | grey 75 | 191 | 191 | 191 | 714 | grey 76 | 194 | 194 | 194 | 715 | grey 77 | 196 | 196 | 196 | 716 | grey 78 | 199 | 199 | 199 | 717 | grey 79 | 201 | 201 | 201 | 718 | grey 80 | 204 | 204 | 204 | 719 | grey 81 | 207 | 207 | 207 | 720 | grey 82 | 209 | 209 | 209 | 721 | grey 83 | 212 | 212 | 212 | 722 | grey 84 | 214 | 214 | 214 | 723 | grey 85 | 217 | 217 | 217 | 724 | grey 86 | 219 | 219 | 219 | 725 | grey 87 | 222 | 222 | 222 | 726 | grey 88 | 224 | 224 | 224 | 727 | grey 89 | 227 | 227 | 227 | 728 | grey 90 | 229 | 229 | 229 | 729 | grey 91 | 232 | 232 | 232 | 730 | grey 92 | 235 | 235 | 235 | 731 | grey 93 | 237 | 237 | 237 | 732 | grey 94 | 240 | 240 | 240 | 733 | grey 95 | 242 | 242 | 242 | 734 | grey 96 | 245 | 245 | 245 | 735 | grey 97 | 247 | 247 | 247 | 736 | grey 98 | 250 | 250 | 250 | 737 | grey 99 | 252 | 252 | 252 | 738 | grey 100 | 255 | 255 | 255 | 739 | dark grey | 169 | 169 | 169 | 740 | dark blue | 0 | 0 | 139 | 741 | dark cyan | 0 | 139 | 139 | 742 | dark magenta | 139 | 0 | 139 | 743 | dark red | 139 | 0 | 0 | 744 | light green | 144 | 238 | 144 | 745 |_______________________________|_________|_________|_________| 746 747 """ 748 749 # Initialise the dictionary of colours. 750 colours = {} 751 752 # The colours as sorted in the /usr/X11R6/lib/X11/rgb.txt file. 753 colours['snow'] = [255, 250, 250] 754 colours['ghost white'] = [248, 248, 255] 755 colours['white smoke'] = [245, 245, 245] 756 colours['gainsboro'] = [220, 220, 220] 757 colours['floral white'] = [255, 250, 240] 758 colours['old lace'] = [253, 245, 230] 759 colours['linen'] = [250, 240, 230] 760 colours['antique white'] = [250, 235, 215] 761 colours['papaya whip'] = [255, 239, 213] 762 colours['blanched almond'] = [255, 235, 205] 763 colours['bisque'] = [255, 228, 196] 764 colours['peach puff'] = [255, 218, 185] 765 colours['navajo white'] = [255, 222, 173] 766 colours['moccasin'] = [255, 228, 181] 767 colours['cornsilk'] = [255, 248, 220] 768 colours['ivory'] = [255, 255, 240] 769 colours['lemon chiffon'] = [255, 250, 205] 770 colours['seashell'] = [255, 245, 238] 771 colours['honeydew'] = [240, 255, 240] 772 colours['mint cream'] = [245, 255, 250] 773 colours['azure'] = [240, 255, 255] 774 colours['alice blue'] = [240, 248, 255] 775 colours['lavender'] = [230, 230, 250] 776 colours['lavender blush'] = [255, 240, 245] 777 colours['misty rose'] = [255, 228, 225] 778 colours['white'] = [255, 255, 255] 779 colours['black'] = [ 0, 0, 0] 780 colours['dark slate grey'] = [ 47, 79, 79] 781 colours['dim grey'] = [105, 105, 105] 782 colours['slate grey'] = [112, 128, 144] 783 colours['light slate grey'] = [119, 136, 153] 784 colours['grey'] = [190, 190, 190] 785 colours['light grey'] = [211, 211, 211] 786 colours['midnight blue'] = [ 25, 25, 112] 787 colours['navy'] = [ 0, 0, 128] 788 colours['cornflower blue'] = [100, 149, 237] 789 colours['dark slate blue'] = [ 72, 61, 139] 790 colours['slate blue'] = [106, 90, 205] 791 colours['medium slate blue'] = [123, 104, 238] 792 colours['light slate blue'] = [132, 112, 255] 793 colours['medium blue'] = [ 0, 0, 205] 794 colours['royal blue'] = [ 65, 105, 225] 795 colours['blue'] = [ 0, 0, 255] 796 colours['dodger blue'] = [ 30, 144, 255] 797 colours['deep sky blue'] = [ 0, 191, 255] 798 colours['sky blue'] = [135, 206, 235] 799 colours['light sky blue'] = [135, 206, 250] 800 colours['steel blue'] = [ 70, 130, 180] 801 colours['light steel blue'] = [176, 196, 222] 802 colours['light blue'] = [173, 216, 230] 803 colours['powder blue'] = [176, 224, 230] 804 colours['pale turquoise'] = [175, 238, 238] 805 colours['dark turquoise'] = [ 0, 206, 209] 806 colours['medium turquoise'] = [ 72, 209, 204] 807 colours['turquoise'] = [ 64, 224, 208] 808 colours['cyan'] = [ 0, 255, 255] 809 colours['light cyan'] = [224, 255, 255] 810 colours['cadet blue'] = [ 95, 158, 160] 811 colours['medium aquamarine'] = [102, 205, 170] 812 colours['aquamarine'] = [127, 255, 212] 813 colours['dark green'] = [ 0, 100, 0] 814 colours['dark olive green'] = [ 85, 107, 47] 815 colours['dark sea green'] = [143, 188, 143] 816 colours['sea green'] = [ 46, 139, 87] 817 colours['medium sea green'] = [ 60, 179, 113] 818 colours['light sea green'] = [ 32, 178, 170] 819 colours['pale green'] = [152, 251, 152] 820 colours['spring green'] = [ 0, 255, 127] 821 colours['lawn green'] = [124, 252, 0] 822 colours['green'] = [ 0, 255, 0] 823 colours['chartreuse'] = [127, 255, 0] 824 colours['medium spring green'] = [ 0, 250, 154] 825 colours['green yellow'] = [173, 255, 47] 826 colours['lime green'] = [ 50, 205, 50] 827 colours['yellow green'] = [154, 205, 50] 828 colours['forest green'] = [ 34, 139, 34] 829 colours['olive drab'] = [107, 142, 35] 830 colours['dark khaki'] = [189, 183, 107] 831 colours['khaki'] = [240, 230, 140] 832 colours['pale goldenrod'] = [238, 232, 170] 833 colours['light goldenrod yellow'] = [250, 250, 210] 834 colours['light yellow'] = [255, 255, 224] 835 colours['yellow'] = [255, 255, 0] 836 colours['gold'] = [255, 215, 0] 837 colours['light goldenrod'] = [238, 221, 130] 838 colours['goldenrod'] = [218, 165, 32] 839 colours['dark goldenrod'] = [184, 134, 11] 840 colours['rosy brown'] = [188, 143, 143] 841 colours['indian red'] = [205, 92, 92] 842 colours['saddle brown'] = [139, 69, 19] 843 colours['sienna'] = [160, 82, 45] 844 colours['peru'] = [205, 133, 63] 845 colours['burlywood'] = [222, 184, 135] 846 colours['beige'] = [245, 245, 220] 847 colours['wheat'] = [245, 222, 179] 848 colours['sandy brown'] = [244, 164, 96] 849 colours['tan'] = [210, 180, 140] 850 colours['chocolate'] = [210, 105, 30] 851 colours['firebrick'] = [178, 34, 34] 852 colours['brown'] = [165, 42, 42] 853 colours['dark salmon'] = [233, 150, 122] 854 colours['salmon'] = [250, 128, 114] 855 colours['light salmon'] = [255, 160, 122] 856 colours['orange'] = [255, 165, 0] 857 colours['dark orange'] = [255, 140, 0] 858 colours['coral'] = [255, 127, 80] 859 colours['light coral'] = [240, 128, 128] 860 colours['tomato'] = [255, 99, 71] 861 colours['orange red'] = [255, 69, 0] 862 colours['red'] = [255, 0, 0] 863 colours['hot pink'] = [255, 105, 180] 864 colours['deep pink'] = [255, 20, 147] 865 colours['pink'] = [255, 192, 203] 866 colours['light pink'] = [255, 182, 193] 867 colours['pale violet red'] = [219, 112, 147] 868 colours['maroon'] = [176, 48, 96] 869 colours['medium violet red'] = [199, 21, 133] 870 colours['violet red'] = [208, 32, 144] 871 colours['magenta'] = [255, 0, 255] 872 colours['violet'] = [238, 130, 238] 873 colours['plum'] = [221, 160, 221] 874 colours['orchid'] = [218, 112, 214] 875 colours['medium orchid'] = [186, 85, 211] 876 colours['dark orchid'] = [153, 50, 204] 877 colours['dark violet'] = [148, 0, 211] 878 colours['blue violet'] = [138, 43, 226] 879 colours['purple'] = [160, 32, 240] 880 colours['medium purple'] = [147, 112, 219] 881 colours['thistle'] = [216, 191, 216] 882 colours['snow 1'] = [255, 250, 250] 883 colours['snow 2'] = [238, 233, 233] 884 colours['snow 3'] = [205, 201, 201] 885 colours['snow 4'] = [139, 137, 137] 886 colours['seashell 1'] = [255, 245, 238] 887 colours['seashell 2'] = [238, 229, 222] 888 colours['seashell 3'] = [205, 197, 191] 889 colours['seashell 4'] = [139, 134, 130] 890 colours['antique white 1'] = [255, 239, 219] 891 colours['antique white 2'] = [238, 223, 204] 892 colours['antique white 3'] = [205, 192, 176] 893 colours['antique white 4'] = [139, 131, 120] 894 colours['bisque 1'] = [255, 228, 196] 895 colours['bisque 2'] = [238, 213, 183] 896 colours['bisque 3'] = [205, 183, 158] 897 colours['bisque 4'] = [139, 125, 107] 898 colours['peach puff 1'] = [255, 218, 185] 899 colours['peach puff 2'] = [238, 203, 173] 900 colours['peach puff 3'] = [205, 175, 149] 901 colours['peach puff 4'] = [139, 119, 101] 902 colours['navajo white 1'] = [255, 222, 173] 903 colours['navajo white 2'] = [238, 207, 161] 904 colours['navajo white 3'] = [205, 179, 139] 905 colours['navajo white 4'] = [139, 121, 94] 906 colours['lemon chiffon 1'] = [255, 250, 205] 907 colours['lemon chiffon 2'] = [238, 233, 191] 908 colours['lemon chiffon 3'] = [205, 201, 165] 909 colours['lemon chiffon 4'] = [139, 137, 112] 910 colours['cornsilk 1'] = [255, 248, 220] 911 colours['cornsilk 2'] = [238, 232, 205] 912 colours['cornsilk 3'] = [205, 200, 177] 913 colours['cornsilk 4'] = [139, 136, 120] 914 colours['ivory 1'] = [255, 255, 240] 915 colours['ivory 2'] = [238, 238, 224] 916 colours['ivory 3'] = [205, 205, 193] 917 colours['ivory 4'] = [139, 139, 131] 918 colours['honeydew 1'] = [240, 255, 240] 919 colours['honeydew 2'] = [224, 238, 224] 920 colours['honeydew 3'] = [193, 205, 193] 921 colours['honeydew 4'] = [131, 139, 131] 922 colours['lavender blush 1'] = [255, 240, 245] 923 colours['lavender blush 2'] = [238, 224, 229] 924 colours['lavender blush 3'] = [205, 193, 197] 925 colours['lavender blush 4'] = [139, 131, 134] 926 colours['misty rose 1'] = [255, 228, 225] 927 colours['misty rose 2'] = [238, 213, 210] 928 colours['misty rose 3'] = [205, 183, 181] 929 colours['misty rose 4'] = [139, 125, 123] 930 colours['azure 1'] = [240, 255, 255] 931 colours['azure 2'] = [224, 238, 238] 932 colours['azure 3'] = [193, 205, 205] 933 colours['azure 4'] = [131, 139, 139] 934 colours['slate blue 1'] = [131, 111, 255] 935 colours['slate blue 2'] = [122, 103, 238] 936 colours['slate blue 3'] = [105, 89, 205] 937 colours['slate blue 4'] = [ 71, 60, 139] 938 colours['royal blue 1'] = [ 72, 118, 255] 939 colours['royal blue 2'] = [ 67, 110, 238] 940 colours['royal blue 3'] = [ 58, 95, 205] 941 colours['royal blue 4'] = [ 39, 64, 139] 942 colours['blue 1'] = [ 0, 0, 255] 943 colours['blue 2'] = [ 0, 0, 238] 944 colours['blue 3'] = [ 0, 0, 205] 945 colours['blue 4'] = [ 0, 0, 139] 946 colours['dodger blue 1'] = [ 30, 144, 255] 947 colours['dodger blue 2'] = [ 28, 134, 238] 948 colours['dodger blue 3'] = [ 24, 116, 205] 949 colours['dodger blue 4'] = [ 16, 78, 139] 950 colours['steel blue 1'] = [ 99, 184, 255] 951 colours['steel blue 2'] = [ 92, 172, 238] 952 colours['steel blue 3'] = [ 79, 148, 205] 953 colours['steel blue 4'] = [ 54, 100, 139] 954 colours['deep sky blue 1'] = [ 0, 191, 255] 955 colours['deep sky blue 2'] = [ 0, 178, 238] 956 colours['deep sky blue 3'] = [ 0, 154, 205] 957 colours['deep sky blue 4'] = [ 0, 104, 139] 958 colours['sky blue 1'] = [135, 206, 255] 959 colours['sky blue 2'] = [126, 192, 238] 960 colours['sky blue 3'] = [108, 166, 205] 961 colours['sky blue 4'] = [ 74, 112, 139] 962 colours['light sky blue 1'] = [176, 226, 255] 963 colours['light sky blue 2'] = [164, 211, 238] 964 colours['light sky blue 3'] = [141, 182, 205] 965 colours['light sky blue 4'] = [ 96, 123, 139] 966 colours['slate grey 1'] = [198, 226, 255] 967 colours['slate grey 2'] = [185, 211, 238] 968 colours['slate grey 3'] = [159, 182, 205] 969 colours['slate grey 4'] = [108, 123, 139] 970 colours['light steel blue 1'] = [202, 225, 255] 971 colours['light steel blue 2'] = [188, 210, 238] 972 colours['light steel blue 3'] = [162, 181, 205] 973 colours['light steel blue 4'] = [110, 123, 139] 974 colours['light blue 1'] = [191, 239, 255] 975 colours['light blue 2'] = [178, 223, 238] 976 colours['light blue 3'] = [154, 192, 205] 977 colours['light blue 4'] = [104, 131, 139] 978 colours['light cyan 1'] = [224, 255, 255] 979 colours['light cyan 2'] = [209, 238, 238] 980 colours['light cyan 3'] = [180, 205, 205] 981 colours['light cyan 4'] = [122, 139, 139] 982 colours['pale turquoise 1'] = [187, 255, 255] 983 colours['pale turquoise 2'] = [174, 238, 238] 984 colours['pale turquoise 3'] = [150, 205, 205] 985 colours['pale turquoise 4'] = [102, 139, 139] 986 colours['cadet blue 1'] = [152, 245, 255] 987 colours['cadet blue 2'] = [142, 229, 238] 988 colours['cadet blue 3'] = [122, 197, 205] 989 colours['cadet blue 4'] = [ 83, 134, 139] 990 colours['turquoise 1'] = [ 0, 245, 255] 991 colours['turquoise 2'] = [ 0, 229, 238] 992 colours['turquoise 3'] = [ 0, 197, 205] 993 colours['turquoise 4'] = [ 0, 134, 139] 994 colours['cyan 1'] = [ 0, 255, 255] 995 colours['cyan 2'] = [ 0, 238, 238] 996 colours['cyan 3'] = [ 0, 205, 205] 997 colours['cyan 4'] = [ 0, 139, 139] 998 colours['dark slate grey 1'] = [151, 255, 255] 999 colours['dark slate grey 2'] = [141, 238, 238] 1000 colours['dark slate grey 3'] = [121, 205, 205] 1001 colours['dark slate grey 4'] = [ 82, 139, 139] 1002 colours['aquamarine 1'] = [127, 255, 212] 1003 colours['aquamarine 2'] = [118, 238, 198] 1004 colours['aquamarine 3'] = [102, 205, 170] 1005 colours['aquamarine 4'] = [ 69, 139, 116] 1006 colours['dark sea green 1'] = [193, 255, 193] 1007 colours['dark sea green 2'] = [180, 238, 180] 1008 colours['dark sea green 3'] = [155, 205, 155] 1009 colours['dark sea green 4'] = [105, 139, 105] 1010 colours['sea green 1'] = [ 84, 255, 159] 1011 colours['sea green 2'] = [ 78, 238, 148] 1012 colours['sea green 3'] = [ 67, 205, 128] 1013 colours['sea green 4'] = [ 46, 139, 87] 1014 colours['pale green 1'] = [154, 255, 154] 1015 colours['pale green 2'] = [144, 238, 144] 1016 colours['pale green 3'] = [124, 205, 124] 1017 colours['pale green 4'] = [ 84, 139, 84] 1018 colours['spring green 1'] = [ 0, 255, 127] 1019 colours['spring green 2'] = [ 0, 238, 118] 1020 colours['spring green 3'] = [ 0, 205, 102] 1021 colours['spring green 4'] = [ 0, 139, 69] 1022 colours['green 1'] = [ 0, 255, 0] 1023 colours['green 2'] = [ 0, 238, 0] 1024 colours['green 3'] = [ 0, 205, 0] 1025 colours['green 4'] = [ 0, 139, 0] 1026 colours['chartreuse 1'] = [127, 255, 0] 1027 colours['chartreuse 2'] = [118, 238, 0] 1028 colours['chartreuse 3'] = [102, 205, 0] 1029 colours['chartreuse 4'] = [ 69, 139, 0] 1030 colours['olive drab 1'] = [192, 255, 62] 1031 colours['olive drab 2'] = [179, 238, 58] 1032 colours['olive drab 3'] = [154, 205, 50] 1033 colours['olive drab 4'] = [105, 139, 34] 1034 colours['dark olive green 1'] = [202, 255, 112] 1035 colours['dark olive green 2'] = [188, 238, 104] 1036 colours['dark olive green 3'] = [162, 205, 90] 1037 colours['dark olive green 4'] = [110, 139, 61] 1038 colours['khaki 1'] = [255, 246, 143] 1039 colours['khaki 2'] = [238, 230, 133] 1040 colours['khaki 3'] = [205, 198, 115] 1041 colours['khaki 4'] = [139, 134, 78] 1042 colours['light goldenrod 1'] = [255, 236, 139] 1043 colours['light goldenrod 2'] = [238, 220, 130] 1044 colours['light goldenrod 3'] = [205, 190, 112] 1045 colours['light goldenrod 4'] = [139, 129, 76] 1046 colours['light yellow 1'] = [255, 255, 224] 1047 colours['light yellow 2'] = [238, 238, 209] 1048 colours['light yellow 3'] = [205, 205, 180] 1049 colours['light yellow 4'] = [139, 139, 122] 1050 colours['yellow 1'] = [255, 255, 0] 1051 colours['yellow 2'] = [238, 238, 0] 1052 colours['yellow 3'] = [205, 205, 0] 1053 colours['yellow 4'] = [139, 139, 0] 1054 colours['gold 1'] = [255, 215, 0] 1055 colours['gold 2'] = [238, 201, 0] 1056 colours['gold 3'] = [205, 173, 0] 1057 colours['gold 4'] = [139, 117, 0] 1058 colours['goldenrod 1'] = [255, 193, 37] 1059 colours['goldenrod 2'] = [238, 180, 34] 1060 colours['goldenrod 3'] = [205, 155, 29] 1061 colours['goldenrod 4'] = [139, 105, 20] 1062 colours['dark goldenrod 1'] = [255, 185, 15] 1063 colours['dark goldenrod 2'] = [238, 173, 14] 1064 colours['dark goldenrod 3'] = [205, 149, 12] 1065 colours['dark goldenrod 4'] = [139, 101, 8] 1066 colours['rosy brown 1'] = [255, 193, 193] 1067 colours['rosy brown 2'] = [238, 180, 180] 1068 colours['rosy brown 3'] = [205, 155, 155] 1069 colours['rosy brown 4'] = [139, 105, 105] 1070 colours['indian red 1'] = [255, 106, 106] 1071 colours['indian red 2'] = [238, 99, 99] 1072 colours['indian red 3'] = [205, 85, 85] 1073 colours['indian red 4'] = [139, 58, 58] 1074 colours['sienna 1'] = [255, 130, 71] 1075 colours['sienna 2'] = [238, 121, 66] 1076 colours['sienna 3'] = [205, 104, 57] 1077 colours['sienna 4'] = [139, 71, 38] 1078 colours['burlywood 1'] = [255, 211, 155] 1079 colours['burlywood 2'] = [238, 197, 145] 1080 colours['burlywood 3'] = [205, 170, 125] 1081 colours['burlywood 4'] = [139, 115, 85] 1082 colours['wheat 1'] = [255, 231, 186] 1083 colours['wheat 2'] = [238, 216, 174] 1084 colours['wheat 3'] = [205, 186, 150] 1085 colours['wheat 4'] = [139, 126, 102] 1086 colours['tan 1'] = [255, 165, 79] 1087 colours['tan 2'] = [238, 154, 73] 1088 colours['tan 3'] = [205, 133, 63] 1089 colours['tan 4'] = [139, 90, 43] 1090 colours['chocolate 1'] = [255, 127, 36] 1091 colours['chocolate 2'] = [238, 118, 33] 1092 colours['chocolate 3'] = [205, 102, 29] 1093 colours['chocolate 4'] = [139, 69, 19] 1094 colours['firebrick 1'] = [255, 48, 48] 1095 colours['firebrick 2'] = [238, 44, 44] 1096 colours['firebrick 3'] = [205, 38, 38] 1097 colours['firebrick 4'] = [139, 26, 26] 1098 colours['brown 1'] = [255, 64, 64] 1099 colours['brown 2'] = [238, 59, 59] 1100 colours['brown 3'] = [205, 51, 51] 1101 colours['brown 4'] = [139, 35, 35] 1102 colours['salmon 1'] = [255, 140, 105] 1103 colours['salmon 2'] = [238, 130, 98] 1104 colours['salmon 3'] = [205, 112, 84] 1105 colours['salmon 4'] = [139, 76, 57] 1106 colours['light salmon 1'] = [255, 160, 122] 1107 colours['light salmon 2'] = [238, 149, 114] 1108 colours['light salmon 3'] = [205, 129, 98] 1109 colours['light salmon 4'] = [139, 87, 66] 1110 colours['orange 1'] = [255, 165, 0] 1111 colours['orange 2'] = [238, 154, 0] 1112 colours['orange 3'] = [205, 133, 0] 1113 colours['orange 4'] = [139, 90, 0] 1114 colours['dark orange 1'] = [255, 127, 0] 1115 colours['dark orange 2'] = [238, 118, 0] 1116 colours['dark orange 3'] = [205, 102, 0] 1117 colours['dark orange 4'] = [139, 69, 0] 1118 colours['coral 1'] = [255, 114, 86] 1119 colours['coral 2'] = [238, 106, 80] 1120 colours['coral 3'] = [205, 91, 69] 1121 colours['coral 4'] = [139, 62, 47] 1122 colours['tomato 1'] = [255, 99, 71] 1123 colours['tomato 2'] = [238, 92, 66] 1124 colours['tomato 3'] = [205, 79, 57] 1125 colours['tomato 4'] = [139, 54, 38] 1126 colours['orange red 1'] = [255, 69, 0] 1127 colours['orange red 2'] = [238, 64, 0] 1128 colours['orange red 3'] = [205, 55, 0] 1129 colours['orange red 4'] = [139, 37, 0] 1130 colours['red 1'] = [255, 0, 0] 1131 colours['red 2'] = [238, 0, 0] 1132 colours['red 3'] = [205, 0, 0] 1133 colours['red 4'] = [139, 0, 0] 1134 colours['deep pink 1'] = [255, 20, 147] 1135 colours['deep pink 2'] = [238, 18, 137] 1136 colours['deep pink 3'] = [205, 16, 118] 1137 colours['deep pink 4'] = [139, 10, 80] 1138 colours['hot pink 1'] = [255, 110, 180] 1139 colours['hot pink 2'] = [238, 106, 167] 1140 colours['hot pink 3'] = [205, 96, 144] 1141 colours['hot pink 4'] = [139, 58, 98] 1142 colours['pink 1'] = [255, 181, 197] 1143 colours['pink 2'] = [238, 169, 184] 1144 colours['pink 3'] = [205, 145, 158] 1145 colours['pink 4'] = [139, 99, 108] 1146 colours['light pink 1'] = [255, 174, 185] 1147 colours['light pink 2'] = [238, 162, 173] 1148 colours['light pink 3'] = [205, 140, 149] 1149 colours['light pink 4'] = [139, 95, 101] 1150 colours['pale violet red 1'] = [255, 130, 171] 1151 colours['pale violet red 2'] = [238, 121, 159] 1152 colours['pale violet red 3'] = [205, 104, 137] 1153 colours['pale violet red 4'] = [139, 71, 93] 1154 colours['maroon 1'] = [255, 52, 179] 1155 colours['maroon 2'] = [238, 48, 167] 1156 colours['maroon 3'] = [205, 41, 144] 1157 colours['maroon 4'] = [139, 28, 98] 1158 colours['violet red 1'] = [255, 62, 150] 1159 colours['violet red 2'] = [238, 58, 140] 1160 colours['violet red 3'] = [205, 50, 120] 1161 colours['violet red 4'] = [139, 34, 82] 1162 colours['magenta 1'] = [255, 0, 255] 1163 colours['magenta 2'] = [238, 0, 238] 1164 colours['magenta 3'] = [205, 0, 205] 1165 colours['magenta 4'] = [139, 0, 139] 1166 colours['orchid 1'] = [255, 131, 250] 1167 colours['orchid 2'] = [238, 122, 233] 1168 colours['orchid 3'] = [205, 105, 201] 1169 colours['orchid 4'] = [139, 71, 137] 1170 colours['plum 1'] = [255, 187, 255] 1171 colours['plum 2'] = [238, 174, 238] 1172 colours['plum 3'] = [205, 150, 205] 1173 colours['plum 4'] = [139, 102, 139] 1174 colours['medium orchid 1'] = [224, 102, 255] 1175 colours['medium orchid 2'] = [209, 95, 238] 1176 colours['medium orchid 3'] = [180, 82, 205] 1177 colours['medium orchid 4'] = [122, 55, 139] 1178 colours['dark orchid 1'] = [191, 62, 255] 1179 colours['dark orchid 2'] = [178, 58, 238] 1180 colours['dark orchid 3'] = [154, 50, 205] 1181 colours['dark orchid 4'] = [104, 34, 139] 1182 colours['purple 1'] = [155, 48, 255] 1183 colours['purple 2'] = [145, 44, 238] 1184 colours['purple 3'] = [125, 38, 205] 1185 colours['purple 4'] = [ 85, 26, 139] 1186 colours['medium purple 1'] = [171, 130, 255] 1187 colours['medium purple 2'] = [159, 121, 238] 1188 colours['medium purple 3'] = [137, 104, 205] 1189 colours['medium purple 4'] = [ 93, 71, 139] 1190 colours['thistle 1'] = [255, 225, 255] 1191 colours['thistle 2'] = [238, 210, 238] 1192 colours['thistle 3'] = [205, 181, 205] 1193 colours['thistle 4'] = [139, 123, 139] 1194 colours['grey 0'] = [ 0, 0, 0] 1195 colours['grey 1'] = [ 3, 3, 3] 1196 colours['grey 2'] = [ 5, 5, 5] 1197 colours['grey 3'] = [ 8, 8, 8] 1198 colours['grey 4'] = [ 10, 10, 10] 1199 colours['grey 5'] = [ 13, 13, 13] 1200 colours['grey 6'] = [ 15, 15, 15] 1201 colours['grey 7'] = [ 18, 18, 18] 1202 colours['grey 8'] = [ 20, 20, 20] 1203 colours['grey 9'] = [ 23, 23, 23] 1204 colours['grey 10'] = [ 26, 26, 26] 1205 colours['grey 11'] = [ 28, 28, 28] 1206 colours['grey 12'] = [ 31, 31, 31] 1207 colours['grey 13'] = [ 33, 33, 33] 1208 colours['grey 14'] = [ 36, 36, 36] 1209 colours['grey 15'] = [ 38, 38, 38] 1210 colours['grey 16'] = [ 41, 41, 41] 1211 colours['grey 17'] = [ 43, 43, 43] 1212 colours['grey 18'] = [ 46, 46, 46] 1213 colours['grey 19'] = [ 48, 48, 48] 1214 colours['grey 20'] = [ 51, 51, 51] 1215 colours['grey 21'] = [ 54, 54, 54] 1216 colours['grey 22'] = [ 56, 56, 56] 1217 colours['grey 23'] = [ 59, 59, 59] 1218 colours['grey 24'] = [ 61, 61, 61] 1219 colours['grey 25'] = [ 64, 64, 64] 1220 colours['grey 26'] = [ 66, 66, 66] 1221 colours['grey 27'] = [ 69, 69, 69] 1222 colours['grey 28'] = [ 71, 71, 71] 1223 colours['grey 29'] = [ 74, 74, 74] 1224 colours['grey 30'] = [ 77, 77, 77] 1225 colours['grey 31'] = [ 79, 79, 79] 1226 colours['grey 32'] = [ 82, 82, 82] 1227 colours['grey 33'] = [ 84, 84, 84] 1228 colours['grey 34'] = [ 87, 87, 87] 1229 colours['grey 35'] = [ 89, 89, 89] 1230 colours['grey 36'] = [ 92, 92, 92] 1231 colours['grey 37'] = [ 94, 94, 94] 1232 colours['grey 38'] = [ 97, 97, 97] 1233 colours['grey 39'] = [ 99, 99, 99] 1234 colours['grey 40'] = [102, 102, 102] 1235 colours['grey 41'] = [105, 105, 105] 1236 colours['grey 42'] = [107, 107, 107] 1237 colours['grey 43'] = [110, 110, 110] 1238 colours['grey 44'] = [112, 112, 112] 1239 colours['grey 45'] = [115, 115, 115] 1240 colours['grey 46'] = [117, 117, 117] 1241 colours['grey 47'] = [120, 120, 120] 1242 colours['grey 48'] = [122, 122, 122] 1243 colours['grey 49'] = [125, 125, 125] 1244 colours['grey 50'] = [127, 127, 127] 1245 colours['grey 51'] = [130, 130, 130] 1246 colours['grey 52'] = [133, 133, 133] 1247 colours['grey 53'] = [135, 135, 135] 1248 colours['grey 54'] = [138, 138, 138] 1249 colours['grey 55'] = [140, 140, 140] 1250 colours['grey 56'] = [143, 143, 143] 1251 colours['grey 57'] = [145, 145, 145] 1252 colours['grey 58'] = [148, 148, 148] 1253 colours['grey 59'] = [150, 150, 150] 1254 colours['grey 60'] = [153, 153, 153] 1255 colours['grey 61'] = [156, 156, 156] 1256 colours['grey 62'] = [158, 158, 158] 1257 colours['grey 63'] = [161, 161, 161] 1258 colours['grey 64'] = [163, 163, 163] 1259 colours['grey 65'] = [166, 166, 166] 1260 colours['grey 66'] = [168, 168, 168] 1261 colours['grey 67'] = [171, 171, 171] 1262 colours['grey 68'] = [173, 173, 173] 1263 colours['grey 69'] = [176, 176, 176] 1264 colours['grey 70'] = [179, 179, 179] 1265 colours['grey 71'] = [181, 181, 181] 1266 colours['grey 72'] = [184, 184, 184] 1267 colours['grey 73'] = [186, 186, 186] 1268 colours['grey 74'] = [189, 189, 189] 1269 colours['grey 75'] = [191, 191, 191] 1270 colours['grey 76'] = [194, 194, 194] 1271 colours['grey 77'] = [196, 196, 196] 1272 colours['grey 78'] = [199, 199, 199] 1273 colours['grey 79'] = [201, 201, 201] 1274 colours['grey 80'] = [204, 204, 204] 1275 colours['grey 81'] = [207, 207, 207] 1276 colours['grey 82'] = [209, 209, 209] 1277 colours['grey 83'] = [212, 212, 212] 1278 colours['grey 84'] = [214, 214, 214] 1279 colours['grey 85'] = [217, 217, 217] 1280 colours['grey 86'] = [219, 219, 219] 1281 colours['grey 87'] = [222, 222, 222] 1282 colours['grey 88'] = [224, 224, 224] 1283 colours['grey 89'] = [227, 227, 227] 1284 colours['grey 90'] = [229, 229, 229] 1285 colours['grey 91'] = [232, 232, 232] 1286 colours['grey 92'] = [235, 235, 235] 1287 colours['grey 93'] = [237, 237, 237] 1288 colours['grey 94'] = [240, 240, 240] 1289 colours['grey 95'] = [242, 242, 242] 1290 colours['grey 96'] = [245, 245, 245] 1291 colours['grey 97'] = [247, 247, 247] 1292 colours['grey 98'] = [250, 250, 250] 1293 colours['grey 99'] = [252, 252, 252] 1294 colours['grey 100'] = [255, 255, 255] 1295 colours['dark grey'] = [169, 169, 169] 1296 colours['dark blue'] = [ 0, 0, 139] 1297 colours['dark cyan'] = [ 0, 139, 139] 1298 colours['dark magenta'] = [139, 0, 139] 1299 colours['dark red'] = [139, 0, 0] 1300 colours['light green'] = [144, 238, 144] 1301 1302 # Invalid colour string. 1303 if not colours.has_key(name): 1304 raise RelaxInvalidColourError, name 1305 1306 # Return the RGB colour array (in Numeric format and between 0 and 1). 1307 return array(colours[name], Float64) / 255.
1308