Mercurial > emacs
comparison lisp/term/tty-colors.el @ 45716:4dd143567eea
(color-name-rgb-alist): Use 16-bit RGB values instead of 8-bit, for
consistency with the rest of emacs.
(tty-color-canonicalize): Only copy COLOR if we need to change it.
(tty-color-approximate): Scale values from `color-name-rgb-alist'
appropriately. Return the whole color description, rather than just the
RGB values.
(tty-color-standard-values): New function. Code mostly taken from
`tty-color-translate'.
(tty-color-translate, tty-color-values): Use `tty-color-desc' to do all
the work.
(tty-color-desc): Do color lookup here instead of calling
`tty-color-translate' and `tty-color-by-index'; this is now the main
place to do it.
author | Miles Bader <miles@gnu.org> |
---|---|
date | Sun, 09 Jun 2002 12:53:53 +0000 |
parents | de5c4caf0969 |
children | 695cf19ef79e d7ddb3e565de |
comparison
equal
deleted
inserted
replaced
45715:9f0d0f0a1a7e | 45716:4dd143567eea |
---|---|
1 ;;; tty-colors.el --- color support for character terminals | 1 ;;; tty-colors.el --- color support for character terminals |
2 | 2 |
3 ;; Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. |
4 | 4 |
5 ;; Author: Eli Zaretskii <eliz@is.elta.co.il> | 5 ;; Author: Eli Zaretskii <eliz@is.elta.co.il> |
6 ;; Maintainer: FSF | 6 ;; Maintainer: FSF |
7 ;; Keywords: terminals, faces | 7 ;; Keywords: terminals, faces |
8 | 8 |
78 ;; | 78 ;; |
79 ;; For these reasons, package maintaners are advised NOT to use color | 79 ;; For these reasons, package maintaners are advised NOT to use color |
80 ;; names such as "lightred" or "lightblue", because they will have | 80 ;; names such as "lightred" or "lightblue", because they will have |
81 ;; different effect on different displays. Instead, use "red1" and | 81 ;; different effect on different displays. Instead, use "red1" and |
82 ;; "blue1", respectively. | 82 ;; "blue1", respectively. |
83 ;; | |
84 ;; Note: the RGB values below are in the range 0-65535, but are derived | |
85 ;; from the standard 8-bit X definitions (so the upper and lower bytes | |
86 ;; of each value are actually identical). | |
87 ;; | |
83 (defvar color-name-rgb-alist | 88 (defvar color-name-rgb-alist |
84 '(("snow" 255 250 250) | 89 '(("snow" 65535 64250 64250) |
85 ("ghostwhite" 248 248 255) | 90 ("ghostwhite" 63736 63736 65535) |
86 ("whitesmoke" 245 245 245) | 91 ("whitesmoke" 62965 62965 62965) |
87 ("gainsboro" 220 220 220) | 92 ("gainsboro" 56540 56540 56540) |
88 ("floralwhite" 255 250 240) | 93 ("floralwhite" 65535 64250 61680) |
89 ("oldlace" 253 245 230) | 94 ("oldlace" 65021 62965 59110) |
90 ("linen" 250 240 230) | 95 ("linen" 64250 61680 59110) |
91 ("antiquewhite" 250 235 215) | 96 ("antiquewhite" 64250 60395 55255) |
92 ("papayawhip" 255 239 213) | 97 ("papayawhip" 65535 61423 54741) |
93 ("blanchedalmond" 255 235 205) | 98 ("blanchedalmond" 65535 60395 52685) |
94 ("bisque" 255 228 196) | 99 ("bisque" 65535 58596 50372) |
95 ("peachpuff" 255 218 185) | 100 ("peachpuff" 65535 56026 47545) |
96 ("navajowhite" 255 222 173) | 101 ("navajowhite" 65535 57054 44461) |
97 ("moccasin" 255 228 181) | 102 ("moccasin" 65535 58596 46517) |
98 ("cornsilk" 255 248 220) | 103 ("cornsilk" 65535 63736 56540) |
99 ("ivory" 255 255 240) | 104 ("ivory" 65535 65535 61680) |
100 ("lemonchiffon" 255 250 205) | 105 ("lemonchiffon" 65535 64250 52685) |
101 ("seashell" 255 245 238) | 106 ("seashell" 65535 62965 61166) |
102 ("honeydew" 240 255 240) | 107 ("honeydew" 61680 65535 61680) |
103 ("mintcream" 245 255 250) | 108 ("mintcream" 62965 65535 64250) |
104 ("azure" 240 255 255) | 109 ("azure" 61680 65535 65535) |
105 ("aliceblue" 240 248 255) | 110 ("aliceblue" 61680 63736 65535) |
106 ("lavender" 230 230 250) | 111 ("lavender" 59110 59110 64250) |
107 ("lavenderblush" 255 240 245) | 112 ("lavenderblush" 65535 61680 62965) |
108 ("mistyrose" 255 228 225) | 113 ("mistyrose" 65535 58596 57825) |
109 ("white" 255 255 255) | 114 ("white" 65535 65535 65535) |
110 ("black" 0 0 0) | 115 ("black" 0 0 0) |
111 ("darkslategray" 47 79 79) | 116 ("darkslategray" 12079 20303 20303) |
112 ("darkslategrey" 47 79 79) | 117 ("darkslategrey" 12079 20303 20303) |
113 ("dimgray" 105 105 105) | 118 ("dimgray" 26985 26985 26985) |
114 ("dimgrey" 105 105 105) | 119 ("dimgrey" 26985 26985 26985) |
115 ("slategray" 112 128 144) | 120 ("slategray" 28784 32896 37008) |
116 ("slategrey" 112 128 144) | 121 ("slategrey" 28784 32896 37008) |
117 ("lightslategray" 119 136 153) | 122 ("lightslategray" 30583 34952 39321) |
118 ("lightslategrey" 119 136 153) | 123 ("lightslategrey" 30583 34952 39321) |
119 ("gray" 190 190 190) | 124 ("gray" 48830 48830 48830) |
120 ("grey" 190 190 190) | 125 ("grey" 48830 48830 48830) |
121 ("lightgrey" 211 211 211) | 126 ("lightgrey" 54227 54227 54227) |
122 ("lightgray" 211 211 211) | 127 ("lightgray" 54227 54227 54227) |
123 ("midnightblue" 25 25 112) | 128 ("midnightblue" 6425 6425 28784) |
124 ("navy" 0 0 128) | 129 ("navy" 0 0 32896) |
125 ("navyblue" 0 0 128) | 130 ("navyblue" 0 0 32896) |
126 ("cornflowerblue" 100 149 237) | 131 ("cornflowerblue" 25700 38293 60909) |
127 ("darkslateblue" 72 61 139) | 132 ("darkslateblue" 18504 15677 35723) |
128 ("slateblue" 106 90 205) | 133 ("slateblue" 27242 23130 52685) |
129 ("mediumslateblue" 123 104 238) | 134 ("mediumslateblue" 31611 26728 61166) |
130 ("lightslateblue" 132 112 255) | 135 ("lightslateblue" 33924 28784 65535) |
131 ("mediumblue" 0 0 205) | 136 ("mediumblue" 0 0 52685) |
132 ("royalblue" 65 105 225) | 137 ("royalblue" 16705 26985 57825) |
133 ("blue" 0 0 255) | 138 ("blue" 0 0 65535) |
134 ("dodgerblue" 30 144 255) | 139 ("dodgerblue" 7710 37008 65535) |
135 ("deepskyblue" 0 191 255) | 140 ("deepskyblue" 0 49087 65535) |
136 ("skyblue" 135 206 235) | 141 ("skyblue" 34695 52942 60395) |
137 ("lightskyblue" 135 206 250) | 142 ("lightskyblue" 34695 52942 64250) |
138 ("steelblue" 70 130 180) | 143 ("steelblue" 17990 33410 46260) |
139 ("lightsteelblue" 176 196 222) | 144 ("lightsteelblue" 45232 50372 57054) |
140 ("lightblue" 173 216 230) | 145 ("lightblue" 44461 55512 59110) |
141 ("powderblue" 176 224 230) | 146 ("powderblue" 45232 57568 59110) |
142 ("paleturquoise" 175 238 238) | 147 ("paleturquoise" 44975 61166 61166) |
143 ("darkturquoise" 0 206 209) | 148 ("darkturquoise" 0 52942 53713) |
144 ("mediumturquoise" 72 209 204) | 149 ("mediumturquoise" 18504 53713 52428) |
145 ("turquoise" 64 224 208) | 150 ("turquoise" 16448 57568 53456) |
146 ("cyan" 0 255 255) | 151 ("cyan" 0 65535 65535) |
147 ("lightcyan" 224 255 255) | 152 ("lightcyan" 57568 65535 65535) |
148 ("cadetblue" 95 158 160) | 153 ("cadetblue" 24415 40606 41120) |
149 ("mediumaquamarine" 102 205 170) | 154 ("mediumaquamarine" 26214 52685 43690) |
150 ("aquamarine" 127 255 212) | 155 ("aquamarine" 32639 65535 54484) |
151 ("darkgreen" 0 100 0) | 156 ("darkgreen" 0 25700 0) |
152 ("darkolivegreen" 85 107 47) | 157 ("darkolivegreen" 21845 27499 12079) |
153 ("darkseagreen" 143 188 143) | 158 ("darkseagreen" 36751 48316 36751) |
154 ("seagreen" 46 139 87) | 159 ("seagreen" 11822 35723 22359) |
155 ("mediumseagreen" 60 179 113) | 160 ("mediumseagreen" 15420 46003 29041) |
156 ("lightseagreen" 32 178 170) | 161 ("lightseagreen" 8224 45746 43690) |
157 ("palegreen" 152 251 152) | 162 ("palegreen" 39064 64507 39064) |
158 ("springgreen" 0 255 127) | 163 ("springgreen" 0 65535 32639) |
159 ("lawngreen" 124 252 0) | 164 ("lawngreen" 31868 64764 0) |
160 ("green" 0 255 0) | 165 ("green" 0 65535 0) |
161 ("chartreuse" 127 255 0) | 166 ("chartreuse" 32639 65535 0) |
162 ("mediumspringgreen" 0 250 154) | 167 ("mediumspringgreen" 0 64250 39578) |
163 ("greenyellow" 173 255 47) | 168 ("greenyellow" 44461 65535 12079) |
164 ("limegreen" 50 205 50) | 169 ("limegreen" 12850 52685 12850) |
165 ("yellowgreen" 154 205 50) | 170 ("yellowgreen" 39578 52685 12850) |
166 ("forestgreen" 34 139 34) | 171 ("forestgreen" 8738 35723 8738) |
167 ("olivedrab" 107 142 35) | 172 ("olivedrab" 27499 36494 8995) |
168 ("darkkhaki" 189 183 107) | 173 ("darkkhaki" 48573 47031 27499) |
169 ("khaki" 240 230 140) | 174 ("khaki" 61680 59110 35980) |
170 ("palegoldenrod" 238 232 170) | 175 ("palegoldenrod" 61166 59624 43690) |
171 ("lightgoldenrodyellow" 250 250 210) | 176 ("lightgoldenrodyellow" 64250 64250 53970) |
172 ("lightyellow" 255 255 224) | 177 ("lightyellow" 65535 65535 57568) |
173 ("yellow" 255 255 0) | 178 ("yellow" 65535 65535 0) |
174 ("gold" 255 215 0) | 179 ("gold" 65535 55255 0) |
175 ("lightgoldenrod" 238 221 130) | 180 ("lightgoldenrod" 61166 56797 33410) |
176 ("goldenrod" 218 165 32) | 181 ("goldenrod" 56026 42405 8224) |
177 ("darkgoldenrod" 184 134 11) | 182 ("darkgoldenrod" 47288 34438 2827) |
178 ("rosybrown" 188 143 143) | 183 ("rosybrown" 48316 36751 36751) |
179 ("indianred" 205 92 92) | 184 ("indianred" 52685 23644 23644) |
180 ("saddlebrown" 139 69 19) | 185 ("saddlebrown" 35723 17733 4883) |
181 ("sienna" 160 82 45) | 186 ("sienna" 41120 21074 11565) |
182 ("peru" 205 133 63) | 187 ("peru" 52685 34181 16191) |
183 ("burlywood" 222 184 135) | 188 ("burlywood" 57054 47288 34695) |
184 ("beige" 245 245 220) | 189 ("beige" 62965 62965 56540) |
185 ("wheat" 245 222 179) | 190 ("wheat" 62965 57054 46003) |
186 ("sandybrown" 244 164 96) | 191 ("sandybrown" 62708 42148 24672) |
187 ("tan" 210 180 140) | 192 ("tan" 53970 46260 35980) |
188 ("chocolate" 210 105 30) | 193 ("chocolate" 53970 26985 7710) |
189 ("firebrick" 178 34 34) | 194 ("firebrick" 45746 8738 8738) |
190 ("brown" 165 42 42) | 195 ("brown" 42405 10794 10794) |
191 ("darksalmon" 233 150 122) | 196 ("darksalmon" 59881 38550 31354) |
192 ("salmon" 250 128 114) | 197 ("salmon" 64250 32896 29298) |
193 ("lightsalmon" 255 160 122) | 198 ("lightsalmon" 65535 41120 31354) |
194 ("orange" 255 165 0) | 199 ("orange" 65535 42405 0) |
195 ("darkorange" 255 140 0) | 200 ("darkorange" 65535 35980 0) |
196 ("coral" 255 127 80) | 201 ("coral" 65535 32639 20560) |
197 ("lightcoral" 240 128 128) | 202 ("lightcoral" 61680 32896 32896) |
198 ("tomato" 255 99 71) | 203 ("tomato" 65535 25443 18247) |
199 ("orangered" 255 69 0) | 204 ("orangered" 65535 17733 0) |
200 ("red" 255 0 0) | 205 ("red" 65535 0 0) |
201 ("hotpink" 255 105 180) | 206 ("hotpink" 65535 26985 46260) |
202 ("deeppink" 255 20 147) | 207 ("deeppink" 65535 5140 37779) |
203 ("pink" 255 192 203) | 208 ("pink" 65535 49344 52171) |
204 ("lightpink" 255 182 193) | 209 ("lightpink" 65535 46774 49601) |
205 ("palevioletred" 219 112 147) | 210 ("palevioletred" 56283 28784 37779) |
206 ("maroon" 176 48 96) | 211 ("maroon" 45232 12336 24672) |
207 ("mediumvioletred" 199 21 133) | 212 ("mediumvioletred" 51143 5397 34181) |
208 ("violetred" 208 32 144) | 213 ("violetred" 53456 8224 37008) |
209 ("magenta" 255 0 255) | 214 ("magenta" 65535 0 65535) |
210 ("violet" 238 130 238) | 215 ("violet" 61166 33410 61166) |
211 ("plum" 221 160 221) | 216 ("plum" 56797 41120 56797) |
212 ("orchid" 218 112 214) | 217 ("orchid" 56026 28784 54998) |
213 ("mediumorchid" 186 85 211) | 218 ("mediumorchid" 47802 21845 54227) |
214 ("darkorchid" 153 50 204) | 219 ("darkorchid" 39321 12850 52428) |
215 ("darkviolet" 148 0 211) | 220 ("darkviolet" 38036 0 54227) |
216 ("blueviolet" 138 43 226) | 221 ("blueviolet" 35466 11051 58082) |
217 ("purple" 160 32 240) | 222 ("purple" 41120 8224 61680) |
218 ("mediumpurple" 147 112 219) | 223 ("mediumpurple" 37779 28784 56283) |
219 ("thistle" 216 191 216) | 224 ("thistle" 55512 49087 55512) |
220 ("snow1" 255 250 250) | 225 ("snow1" 65535 64250 64250) |
221 ("snow2" 238 233 233) | 226 ("snow2" 61166 59881 59881) |
222 ("snow3" 205 201 201) | 227 ("snow3" 52685 51657 51657) |
223 ("snow4" 139 137 137) | 228 ("snow4" 35723 35209 35209) |
224 ("seashell1" 255 245 238) | 229 ("seashell1" 65535 62965 61166) |
225 ("seashell2" 238 229 222) | 230 ("seashell2" 61166 58853 57054) |
226 ("seashell3" 205 197 191) | 231 ("seashell3" 52685 50629 49087) |
227 ("seashell4" 139 134 130) | 232 ("seashell4" 35723 34438 33410) |
228 ("antiquewhite1" 255 239 219) | 233 ("antiquewhite1" 65535 61423 56283) |
229 ("antiquewhite2" 238 223 204) | 234 ("antiquewhite2" 61166 57311 52428) |
230 ("antiquewhite3" 205 192 176) | 235 ("antiquewhite3" 52685 49344 45232) |
231 ("antiquewhite4" 139 131 120) | 236 ("antiquewhite4" 35723 33667 30840) |
232 ("bisque1" 255 228 196) | 237 ("bisque1" 65535 58596 50372) |
233 ("bisque2" 238 213 183) | 238 ("bisque2" 61166 54741 47031) |
234 ("bisque3" 205 183 158) | 239 ("bisque3" 52685 47031 40606) |
235 ("bisque4" 139 125 107) | 240 ("bisque4" 35723 32125 27499) |
236 ("peachpuff1" 255 218 185) | 241 ("peachpuff1" 65535 56026 47545) |
237 ("peachpuff2" 238 203 173) | 242 ("peachpuff2" 61166 52171 44461) |
238 ("peachpuff3" 205 175 149) | 243 ("peachpuff3" 52685 44975 38293) |
239 ("peachpuff4" 139 119 101) | 244 ("peachpuff4" 35723 30583 25957) |
240 ("navajowhite1" 255 222 173) | 245 ("navajowhite1" 65535 57054 44461) |
241 ("navajowhite2" 238 207 161) | 246 ("navajowhite2" 61166 53199 41377) |
242 ("navajowhite3" 205 179 139) | 247 ("navajowhite3" 52685 46003 35723) |
243 ("navajowhite4" 139 121 94) | 248 ("navajowhite4" 35723 31097 24158) |
244 ("lemonchiffon1" 255 250 205) | 249 ("lemonchiffon1" 65535 64250 52685) |
245 ("lemonchiffon2" 238 233 191) | 250 ("lemonchiffon2" 61166 59881 49087) |
246 ("lemonchiffon3" 205 201 165) | 251 ("lemonchiffon3" 52685 51657 42405) |
247 ("lemonchiffon4" 139 137 112) | 252 ("lemonchiffon4" 35723 35209 28784) |
248 ("cornsilk1" 255 248 220) | 253 ("cornsilk1" 65535 63736 56540) |
249 ("cornsilk2" 238 232 205) | 254 ("cornsilk2" 61166 59624 52685) |
250 ("cornsilk3" 205 200 177) | 255 ("cornsilk3" 52685 51400 45489) |
251 ("cornsilk4" 139 136 120) | 256 ("cornsilk4" 35723 34952 30840) |
252 ("ivory1" 255 255 240) | 257 ("ivory1" 65535 65535 61680) |
253 ("ivory2" 238 238 224) | 258 ("ivory2" 61166 61166 57568) |
254 ("ivory3" 205 205 193) | 259 ("ivory3" 52685 52685 49601) |
255 ("ivory4" 139 139 131) | 260 ("ivory4" 35723 35723 33667) |
256 ("honeydew1" 240 255 240) | 261 ("honeydew1" 61680 65535 61680) |
257 ("honeydew2" 224 238 224) | 262 ("honeydew2" 57568 61166 57568) |
258 ("honeydew3" 193 205 193) | 263 ("honeydew3" 49601 52685 49601) |
259 ("honeydew4" 131 139 131) | 264 ("honeydew4" 33667 35723 33667) |
260 ("lavenderblush1" 255 240 245) | 265 ("lavenderblush1" 65535 61680 62965) |
261 ("lavenderblush2" 238 224 229) | 266 ("lavenderblush2" 61166 57568 58853) |
262 ("lavenderblush3" 205 193 197) | 267 ("lavenderblush3" 52685 49601 50629) |
263 ("lavenderblush4" 139 131 134) | 268 ("lavenderblush4" 35723 33667 34438) |
264 ("mistyrose1" 255 228 225) | 269 ("mistyrose1" 65535 58596 57825) |
265 ("mistyrose2" 238 213 210) | 270 ("mistyrose2" 61166 54741 53970) |
266 ("mistyrose3" 205 183 181) | 271 ("mistyrose3" 52685 47031 46517) |
267 ("mistyrose4" 139 125 123) | 272 ("mistyrose4" 35723 32125 31611) |
268 ("azure1" 240 255 255) | 273 ("azure1" 61680 65535 65535) |
269 ("azure2" 224 238 238) | 274 ("azure2" 57568 61166 61166) |
270 ("azure3" 193 205 205) | 275 ("azure3" 49601 52685 52685) |
271 ("azure4" 131 139 139) | 276 ("azure4" 33667 35723 35723) |
272 ("slateblue1" 131 111 255) | 277 ("slateblue1" 33667 28527 65535) |
273 ("slateblue2" 122 103 238) | 278 ("slateblue2" 31354 26471 61166) |
274 ("slateblue3" 105 89 205) | 279 ("slateblue3" 26985 22873 52685) |
275 ("slateblue4" 71 60 139) | 280 ("slateblue4" 18247 15420 35723) |
276 ("royalblue1" 72 118 255) | 281 ("royalblue1" 18504 30326 65535) |
277 ("royalblue2" 67 110 238) | 282 ("royalblue2" 17219 28270 61166) |
278 ("royalblue3" 58 95 205) | 283 ("royalblue3" 14906 24415 52685) |
279 ("royalblue4" 39 64 139) | 284 ("royalblue4" 10023 16448 35723) |
280 ("blue1" 0 0 255) | 285 ("blue1" 0 0 65535) |
281 ("blue2" 0 0 238) | 286 ("blue2" 0 0 61166) |
282 ("blue3" 0 0 205) | 287 ("blue3" 0 0 52685) |
283 ("blue4" 0 0 139) | 288 ("blue4" 0 0 35723) |
284 ("dodgerblue1" 30 144 255) | 289 ("dodgerblue1" 7710 37008 65535) |
285 ("dodgerblue2" 28 134 238) | 290 ("dodgerblue2" 7196 34438 61166) |
286 ("dodgerblue3" 24 116 205) | 291 ("dodgerblue3" 6168 29812 52685) |
287 ("dodgerblue4" 16 78 139) | 292 ("dodgerblue4" 4112 20046 35723) |
288 ("steelblue1" 99 184 255) | 293 ("steelblue1" 25443 47288 65535) |
289 ("steelblue2" 92 172 238) | 294 ("steelblue2" 23644 44204 61166) |
290 ("steelblue3" 79 148 205) | 295 ("steelblue3" 20303 38036 52685) |
291 ("steelblue4" 54 100 139) | 296 ("steelblue4" 13878 25700 35723) |
292 ("deepskyblue1" 0 191 255) | 297 ("deepskyblue1" 0 49087 65535) |
293 ("deepskyblue2" 0 178 238) | 298 ("deepskyblue2" 0 45746 61166) |
294 ("deepskyblue3" 0 154 205) | 299 ("deepskyblue3" 0 39578 52685) |
295 ("deepskyblue4" 0 104 139) | 300 ("deepskyblue4" 0 26728 35723) |
296 ("skyblue1" 135 206 255) | 301 ("skyblue1" 34695 52942 65535) |
297 ("skyblue2" 126 192 238) | 302 ("skyblue2" 32382 49344 61166) |
298 ("skyblue3" 108 166 205) | 303 ("skyblue3" 27756 42662 52685) |
299 ("skyblue4" 74 112 139) | 304 ("skyblue4" 19018 28784 35723) |
300 ("lightskyblue1" 176 226 255) | 305 ("lightskyblue1" 45232 58082 65535) |
301 ("lightskyblue2" 164 211 238) | 306 ("lightskyblue2" 42148 54227 61166) |
302 ("lightskyblue3" 141 182 205) | 307 ("lightskyblue3" 36237 46774 52685) |
303 ("lightskyblue4" 96 123 139) | 308 ("lightskyblue4" 24672 31611 35723) |
304 ("slategray1" 198 226 255) | 309 ("slategray1" 50886 58082 65535) |
305 ("slategray2" 185 211 238) | 310 ("slategray2" 47545 54227 61166) |
306 ("slategray3" 159 182 205) | 311 ("slategray3" 40863 46774 52685) |
307 ("slategray4" 108 123 139) | 312 ("slategray4" 27756 31611 35723) |
308 ("lightsteelblue1" 202 225 255) | 313 ("lightsteelblue1" 51914 57825 65535) |
309 ("lightsteelblue2" 188 210 238) | 314 ("lightsteelblue2" 48316 53970 61166) |
310 ("lightsteelblue3" 162 181 205) | 315 ("lightsteelblue3" 41634 46517 52685) |
311 ("lightsteelblue4" 110 123 139) | 316 ("lightsteelblue4" 28270 31611 35723) |
312 ("lightblue1" 191 239 255) | 317 ("lightblue1" 49087 61423 65535) |
313 ("lightblue2" 178 223 238) | 318 ("lightblue2" 45746 57311 61166) |
314 ("lightblue3" 154 192 205) | 319 ("lightblue3" 39578 49344 52685) |
315 ("lightblue4" 104 131 139) | 320 ("lightblue4" 26728 33667 35723) |
316 ("lightcyan1" 224 255 255) | 321 ("lightcyan1" 57568 65535 65535) |
317 ("lightcyan2" 209 238 238) | 322 ("lightcyan2" 53713 61166 61166) |
318 ("lightcyan3" 180 205 205) | 323 ("lightcyan3" 46260 52685 52685) |
319 ("lightcyan4" 122 139 139) | 324 ("lightcyan4" 31354 35723 35723) |
320 ("paleturquoise1" 187 255 255) | 325 ("paleturquoise1" 48059 65535 65535) |
321 ("paleturquoise2" 174 238 238) | 326 ("paleturquoise2" 44718 61166 61166) |
322 ("paleturquoise3" 150 205 205) | 327 ("paleturquoise3" 38550 52685 52685) |
323 ("paleturquoise4" 102 139 139) | 328 ("paleturquoise4" 26214 35723 35723) |
324 ("cadetblue1" 152 245 255) | 329 ("cadetblue1" 39064 62965 65535) |
325 ("cadetblue2" 142 229 238) | 330 ("cadetblue2" 36494 58853 61166) |
326 ("cadetblue3" 122 197 205) | 331 ("cadetblue3" 31354 50629 52685) |
327 ("cadetblue4" 83 134 139) | 332 ("cadetblue4" 21331 34438 35723) |
328 ("turquoise1" 0 245 255) | 333 ("turquoise1" 0 62965 65535) |
329 ("turquoise2" 0 229 238) | 334 ("turquoise2" 0 58853 61166) |
330 ("turquoise3" 0 197 205) | 335 ("turquoise3" 0 50629 52685) |
331 ("turquoise4" 0 134 139) | 336 ("turquoise4" 0 34438 35723) |
332 ("cyan1" 0 255 255) | 337 ("cyan1" 0 65535 65535) |
333 ("cyan2" 0 238 238) | 338 ("cyan2" 0 61166 61166) |
334 ("cyan3" 0 205 205) | 339 ("cyan3" 0 52685 52685) |
335 ("cyan4" 0 139 139) | 340 ("cyan4" 0 35723 35723) |
336 ("darkslategray1" 151 255 255) | 341 ("darkslategray1" 38807 65535 65535) |
337 ("darkslategray2" 141 238 238) | 342 ("darkslategray2" 36237 61166 61166) |
338 ("darkslategray3" 121 205 205) | 343 ("darkslategray3" 31097 52685 52685) |
339 ("darkslategray4" 82 139 139) | 344 ("darkslategray4" 21074 35723 35723) |
340 ("aquamarine1" 127 255 212) | 345 ("aquamarine1" 32639 65535 54484) |
341 ("aquamarine2" 118 238 198) | 346 ("aquamarine2" 30326 61166 50886) |
342 ("aquamarine3" 102 205 170) | 347 ("aquamarine3" 26214 52685 43690) |
343 ("aquamarine4" 69 139 116) | 348 ("aquamarine4" 17733 35723 29812) |
344 ("darkseagreen1" 193 255 193) | 349 ("darkseagreen1" 49601 65535 49601) |
345 ("darkseagreen2" 180 238 180) | 350 ("darkseagreen2" 46260 61166 46260) |
346 ("darkseagreen3" 155 205 155) | 351 ("darkseagreen3" 39835 52685 39835) |
347 ("darkseagreen4" 105 139 105) | 352 ("darkseagreen4" 26985 35723 26985) |
348 ("seagreen1" 84 255 159) | 353 ("seagreen1" 21588 65535 40863) |
349 ("seagreen2" 78 238 148) | 354 ("seagreen2" 20046 61166 38036) |
350 ("seagreen3" 67 205 128) | 355 ("seagreen3" 17219 52685 32896) |
351 ("seagreen4" 46 139 87) | 356 ("seagreen4" 11822 35723 22359) |
352 ("palegreen1" 154 255 154) | 357 ("palegreen1" 39578 65535 39578) |
353 ("palegreen2" 144 238 144) | 358 ("palegreen2" 37008 61166 37008) |
354 ("palegreen3" 124 205 124) | 359 ("palegreen3" 31868 52685 31868) |
355 ("palegreen4" 84 139 84) | 360 ("palegreen4" 21588 35723 21588) |
356 ("springgreen1" 0 255 127) | 361 ("springgreen1" 0 65535 32639) |
357 ("springgreen2" 0 238 118) | 362 ("springgreen2" 0 61166 30326) |
358 ("springgreen3" 0 205 102) | 363 ("springgreen3" 0 52685 26214) |
359 ("springgreen4" 0 139 69) | 364 ("springgreen4" 0 35723 17733) |
360 ("green1" 0 255 0) | 365 ("green1" 0 65535 0) |
361 ("green2" 0 238 0) | 366 ("green2" 0 61166 0) |
362 ("green3" 0 205 0) | 367 ("green3" 0 52685 0) |
363 ("green4" 0 139 0) | 368 ("green4" 0 35723 0) |
364 ("chartreuse1" 127 255 0) | 369 ("chartreuse1" 32639 65535 0) |
365 ("chartreuse2" 118 238 0) | 370 ("chartreuse2" 30326 61166 0) |
366 ("chartreuse3" 102 205 0) | 371 ("chartreuse3" 26214 52685 0) |
367 ("chartreuse4" 69 139 0) | 372 ("chartreuse4" 17733 35723 0) |
368 ("olivedrab1" 192 255 62) | 373 ("olivedrab1" 49344 65535 15934) |
369 ("olivedrab2" 179 238 58) | 374 ("olivedrab2" 46003 61166 14906) |
370 ("olivedrab3" 154 205 50) | 375 ("olivedrab3" 39578 52685 12850) |
371 ("olivedrab4" 105 139 34) | 376 ("olivedrab4" 26985 35723 8738) |
372 ("darkolivegreen1" 202 255 112) | 377 ("darkolivegreen1" 51914 65535 28784) |
373 ("darkolivegreen2" 188 238 104) | 378 ("darkolivegreen2" 48316 61166 26728) |
374 ("darkolivegreen3" 162 205 90) | 379 ("darkolivegreen3" 41634 52685 23130) |
375 ("darkolivegreen4" 110 139 61) | 380 ("darkolivegreen4" 28270 35723 15677) |
376 ("khaki1" 255 246 143) | 381 ("khaki1" 65535 63222 36751) |
377 ("khaki2" 238 230 133) | 382 ("khaki2" 61166 59110 34181) |
378 ("khaki3" 205 198 115) | 383 ("khaki3" 52685 50886 29555) |
379 ("khaki4" 139 134 78) | 384 ("khaki4" 35723 34438 20046) |
380 ("lightgoldenrod1" 255 236 139) | 385 ("lightgoldenrod1" 65535 60652 35723) |
381 ("lightgoldenrod2" 238 220 130) | 386 ("lightgoldenrod2" 61166 56540 33410) |
382 ("lightgoldenrod3" 205 190 112) | 387 ("lightgoldenrod3" 52685 48830 28784) |
383 ("lightgoldenrod4" 139 129 76) | 388 ("lightgoldenrod4" 35723 33153 19532) |
384 ("lightyellow1" 255 255 224) | 389 ("lightyellow1" 65535 65535 57568) |
385 ("lightyellow2" 238 238 209) | 390 ("lightyellow2" 61166 61166 53713) |
386 ("lightyellow3" 205 205 180) | 391 ("lightyellow3" 52685 52685 46260) |
387 ("lightyellow4" 139 139 122) | 392 ("lightyellow4" 35723 35723 31354) |
388 ("yellow1" 255 255 0) | 393 ("yellow1" 65535 65535 0) |
389 ("yellow2" 238 238 0) | 394 ("yellow2" 61166 61166 0) |
390 ("yellow3" 205 205 0) | 395 ("yellow3" 52685 52685 0) |
391 ("yellow4" 139 139 0) | 396 ("yellow4" 35723 35723 0) |
392 ("gold1" 255 215 0) | 397 ("gold1" 65535 55255 0) |
393 ("gold2" 238 201 0) | 398 ("gold2" 61166 51657 0) |
394 ("gold3" 205 173 0) | 399 ("gold3" 52685 44461 0) |
395 ("gold4" 139 117 0) | 400 ("gold4" 35723 30069 0) |
396 ("goldenrod1" 255 193 37) | 401 ("goldenrod1" 65535 49601 9509) |
397 ("goldenrod2" 238 180 34) | 402 ("goldenrod2" 61166 46260 8738) |
398 ("goldenrod3" 205 155 29) | 403 ("goldenrod3" 52685 39835 7453) |
399 ("goldenrod4" 139 105 20) | 404 ("goldenrod4" 35723 26985 5140) |
400 ("darkgoldenrod1" 255 185 15) | 405 ("darkgoldenrod1" 65535 47545 3855) |
401 ("darkgoldenrod2" 238 173 14) | 406 ("darkgoldenrod2" 61166 44461 3598) |
402 ("darkgoldenrod3" 205 149 12) | 407 ("darkgoldenrod3" 52685 38293 3084) |
403 ("darkgoldenrod4" 139 101 8) | 408 ("darkgoldenrod4" 35723 25957 2056) |
404 ("rosybrown1" 255 193 193) | 409 ("rosybrown1" 65535 49601 49601) |
405 ("rosybrown2" 238 180 180) | 410 ("rosybrown2" 61166 46260 46260) |
406 ("rosybrown3" 205 155 155) | 411 ("rosybrown3" 52685 39835 39835) |
407 ("rosybrown4" 139 105 105) | 412 ("rosybrown4" 35723 26985 26985) |
408 ("indianred1" 255 106 106) | 413 ("indianred1" 65535 27242 27242) |
409 ("indianred2" 238 99 99) | 414 ("indianred2" 61166 25443 25443) |
410 ("indianred3" 205 85 85) | 415 ("indianred3" 52685 21845 21845) |
411 ("indianred4" 139 58 58) | 416 ("indianred4" 35723 14906 14906) |
412 ("sienna1" 255 130 71) | 417 ("sienna1" 65535 33410 18247) |
413 ("sienna2" 238 121 66) | 418 ("sienna2" 61166 31097 16962) |
414 ("sienna3" 205 104 57) | 419 ("sienna3" 52685 26728 14649) |
415 ("sienna4" 139 71 38) | 420 ("sienna4" 35723 18247 9766) |
416 ("burlywood1" 255 211 155) | 421 ("burlywood1" 65535 54227 39835) |
417 ("burlywood2" 238 197 145) | 422 ("burlywood2" 61166 50629 37265) |
418 ("burlywood3" 205 170 125) | 423 ("burlywood3" 52685 43690 32125) |
419 ("burlywood4" 139 115 85) | 424 ("burlywood4" 35723 29555 21845) |
420 ("wheat1" 255 231 186) | 425 ("wheat1" 65535 59367 47802) |
421 ("wheat2" 238 216 174) | 426 ("wheat2" 61166 55512 44718) |
422 ("wheat3" 205 186 150) | 427 ("wheat3" 52685 47802 38550) |
423 ("wheat4" 139 126 102) | 428 ("wheat4" 35723 32382 26214) |
424 ("tan1" 255 165 79) | 429 ("tan1" 65535 42405 20303) |
425 ("tan2" 238 154 73) | 430 ("tan2" 61166 39578 18761) |
426 ("tan3" 205 133 63) | 431 ("tan3" 52685 34181 16191) |
427 ("tan4" 139 90 43) | 432 ("tan4" 35723 23130 11051) |
428 ("chocolate1" 255 127 36) | 433 ("chocolate1" 65535 32639 9252) |
429 ("chocolate2" 238 118 33) | 434 ("chocolate2" 61166 30326 8481) |
430 ("chocolate3" 205 102 29) | 435 ("chocolate3" 52685 26214 7453) |
431 ("chocolate4" 139 69 19) | 436 ("chocolate4" 35723 17733 4883) |
432 ("firebrick1" 255 48 48) | 437 ("firebrick1" 65535 12336 12336) |
433 ("firebrick2" 238 44 44) | 438 ("firebrick2" 61166 11308 11308) |
434 ("firebrick3" 205 38 38) | 439 ("firebrick3" 52685 9766 9766) |
435 ("firebrick4" 139 26 26) | 440 ("firebrick4" 35723 6682 6682) |
436 ("brown1" 255 64 64) | 441 ("brown1" 65535 16448 16448) |
437 ("brown2" 238 59 59) | 442 ("brown2" 61166 15163 15163) |
438 ("brown3" 205 51 51) | 443 ("brown3" 52685 13107 13107) |
439 ("brown4" 139 35 35) | 444 ("brown4" 35723 8995 8995) |
440 ("salmon1" 255 140 105) | 445 ("salmon1" 65535 35980 26985) |
441 ("salmon2" 238 130 98) | 446 ("salmon2" 61166 33410 25186) |
442 ("salmon3" 205 112 84) | 447 ("salmon3" 52685 28784 21588) |
443 ("salmon4" 139 76 57) | 448 ("salmon4" 35723 19532 14649) |
444 ("lightsalmon1" 255 160 122) | 449 ("lightsalmon1" 65535 41120 31354) |
445 ("lightsalmon2" 238 149 114) | 450 ("lightsalmon2" 61166 38293 29298) |
446 ("lightsalmon3" 205 129 98) | 451 ("lightsalmon3" 52685 33153 25186) |
447 ("lightsalmon4" 139 87 66) | 452 ("lightsalmon4" 35723 22359 16962) |
448 ("orange1" 255 165 0) | 453 ("orange1" 65535 42405 0) |
449 ("orange2" 238 154 0) | 454 ("orange2" 61166 39578 0) |
450 ("orange3" 205 133 0) | 455 ("orange3" 52685 34181 0) |
451 ("orange4" 139 90 0) | 456 ("orange4" 35723 23130 0) |
452 ("darkorange1" 255 127 0) | 457 ("darkorange1" 65535 32639 0) |
453 ("darkorange2" 238 118 0) | 458 ("darkorange2" 61166 30326 0) |
454 ("darkorange3" 205 102 0) | 459 ("darkorange3" 52685 26214 0) |
455 ("darkorange4" 139 69 0) | 460 ("darkorange4" 35723 17733 0) |
456 ("coral1" 255 114 86) | 461 ("coral1" 65535 29298 22102) |
457 ("coral2" 238 106 80) | 462 ("coral2" 61166 27242 20560) |
458 ("coral3" 205 91 69) | 463 ("coral3" 52685 23387 17733) |
459 ("coral4" 139 62 47) | 464 ("coral4" 35723 15934 12079) |
460 ("tomato1" 255 99 71) | 465 ("tomato1" 65535 25443 18247) |
461 ("tomato2" 238 92 66) | 466 ("tomato2" 61166 23644 16962) |
462 ("tomato3" 205 79 57) | 467 ("tomato3" 52685 20303 14649) |
463 ("tomato4" 139 54 38) | 468 ("tomato4" 35723 13878 9766) |
464 ("orangered1" 255 69 0) | 469 ("orangered1" 65535 17733 0) |
465 ("orangered2" 238 64 0) | 470 ("orangered2" 61166 16448 0) |
466 ("orangered3" 205 55 0) | 471 ("orangered3" 52685 14135 0) |
467 ("orangered4" 139 37 0) | 472 ("orangered4" 35723 9509 0) |
468 ("red1" 255 0 0) | 473 ("red1" 65535 0 0) |
469 ("red2" 238 0 0) | 474 ("red2" 61166 0 0) |
470 ("red3" 205 0 0) | 475 ("red3" 52685 0 0) |
471 ("red4" 139 0 0) | 476 ("red4" 35723 0 0) |
472 ("deeppink1" 255 20 147) | 477 ("deeppink1" 65535 5140 37779) |
473 ("deeppink2" 238 18 137) | 478 ("deeppink2" 61166 4626 35209) |
474 ("deeppink3" 205 16 118) | 479 ("deeppink3" 52685 4112 30326) |
475 ("deeppink4" 139 10 80) | 480 ("deeppink4" 35723 2570 20560) |
476 ("hotpink1" 255 110 180) | 481 ("hotpink1" 65535 28270 46260) |
477 ("hotpink2" 238 106 167) | 482 ("hotpink2" 61166 27242 42919) |
478 ("hotpink3" 205 96 144) | 483 ("hotpink3" 52685 24672 37008) |
479 ("hotpink4" 139 58 98) | 484 ("hotpink4" 35723 14906 25186) |
480 ("pink1" 255 181 197) | 485 ("pink1" 65535 46517 50629) |
481 ("pink2" 238 169 184) | 486 ("pink2" 61166 43433 47288) |
482 ("pink3" 205 145 158) | 487 ("pink3" 52685 37265 40606) |
483 ("pink4" 139 99 108) | 488 ("pink4" 35723 25443 27756) |
484 ("lightpink1" 255 174 185) | 489 ("lightpink1" 65535 44718 47545) |
485 ("lightpink2" 238 162 173) | 490 ("lightpink2" 61166 41634 44461) |
486 ("lightpink3" 205 140 149) | 491 ("lightpink3" 52685 35980 38293) |
487 ("lightpink4" 139 95 101) | 492 ("lightpink4" 35723 24415 25957) |
488 ("palevioletred1" 255 130 171) | 493 ("palevioletred1" 65535 33410 43947) |
489 ("palevioletred2" 238 121 159) | 494 ("palevioletred2" 61166 31097 40863) |
490 ("palevioletred3" 205 104 137) | 495 ("palevioletred3" 52685 26728 35209) |
491 ("palevioletred4" 139 71 93) | 496 ("palevioletred4" 35723 18247 23901) |
492 ("maroon1" 255 52 179) | 497 ("maroon1" 65535 13364 46003) |
493 ("maroon2" 238 48 167) | 498 ("maroon2" 61166 12336 42919) |
494 ("maroon3" 205 41 144) | 499 ("maroon3" 52685 10537 37008) |
495 ("maroon4" 139 28 98) | 500 ("maroon4" 35723 7196 25186) |
496 ("violetred1" 255 62 150) | 501 ("violetred1" 65535 15934 38550) |
497 ("violetred2" 238 58 140) | 502 ("violetred2" 61166 14906 35980) |
498 ("violetred3" 205 50 120) | 503 ("violetred3" 52685 12850 30840) |
499 ("violetred4" 139 34 82) | 504 ("violetred4" 35723 8738 21074) |
500 ("magenta1" 255 0 255) | 505 ("magenta1" 65535 0 65535) |
501 ("magenta2" 238 0 238) | 506 ("magenta2" 61166 0 61166) |
502 ("magenta3" 205 0 205) | 507 ("magenta3" 52685 0 52685) |
503 ("magenta4" 139 0 139) | 508 ("magenta4" 35723 0 35723) |
504 ("orchid1" 255 131 250) | 509 ("orchid1" 65535 33667 64250) |
505 ("orchid2" 238 122 233) | 510 ("orchid2" 61166 31354 59881) |
506 ("orchid3" 205 105 201) | 511 ("orchid3" 52685 26985 51657) |
507 ("orchid4" 139 71 137) | 512 ("orchid4" 35723 18247 35209) |
508 ("plum1" 255 187 255) | 513 ("plum1" 65535 48059 65535) |
509 ("plum2" 238 174 238) | 514 ("plum2" 61166 44718 61166) |
510 ("plum3" 205 150 205) | 515 ("plum3" 52685 38550 52685) |
511 ("plum4" 139 102 139) | 516 ("plum4" 35723 26214 35723) |
512 ("mediumorchid1" 224 102 255) | 517 ("mediumorchid1" 57568 26214 65535) |
513 ("mediumorchid2" 209 95 238) | 518 ("mediumorchid2" 53713 24415 61166) |
514 ("mediumorchid3" 180 82 205) | 519 ("mediumorchid3" 46260 21074 52685) |
515 ("mediumorchid4" 122 55 139) | 520 ("mediumorchid4" 31354 14135 35723) |
516 ("darkorchid1" 191 62 255) | 521 ("darkorchid1" 49087 15934 65535) |
517 ("darkorchid2" 178 58 238) | 522 ("darkorchid2" 45746 14906 61166) |
518 ("darkorchid3" 154 50 205) | 523 ("darkorchid3" 39578 12850 52685) |
519 ("darkorchid4" 104 34 139) | 524 ("darkorchid4" 26728 8738 35723) |
520 ("purple1" 155 48 255) | 525 ("purple1" 39835 12336 65535) |
521 ("purple2" 145 44 238) | 526 ("purple2" 37265 11308 61166) |
522 ("purple3" 125 38 205) | 527 ("purple3" 32125 9766 52685) |
523 ("purple4" 85 26 139) | 528 ("purple4" 21845 6682 35723) |
524 ("mediumpurple1" 171 130 255) | 529 ("mediumpurple1" 43947 33410 65535) |
525 ("mediumpurple2" 159 121 238) | 530 ("mediumpurple2" 40863 31097 61166) |
526 ("mediumpurple3" 137 104 205) | 531 ("mediumpurple3" 35209 26728 52685) |
527 ("mediumpurple4" 93 71 139) | 532 ("mediumpurple4" 23901 18247 35723) |
528 ("thistle1" 255 225 255) | 533 ("thistle1" 65535 57825 65535) |
529 ("thistle2" 238 210 238) | 534 ("thistle2" 61166 53970 61166) |
530 ("thistle3" 205 181 205) | 535 ("thistle3" 52685 46517 52685) |
531 ("thistle4" 139 123 139) | 536 ("thistle4" 35723 31611 35723) |
532 ("gray0" 0 0 0) | 537 ("gray0" 0 0 0) |
533 ("grey0" 0 0 0) | 538 ("grey0" 0 0 0) |
534 ("gray1" 3 3 3) | 539 ("gray1" 771 771 771) |
535 ("grey1" 3 3 3) | 540 ("grey1" 771 771 771) |
536 ("gray2" 5 5 5) | 541 ("gray2" 1285 1285 1285) |
537 ("grey2" 5 5 5) | 542 ("grey2" 1285 1285 1285) |
538 ("gray3" 8 8 8) | 543 ("gray3" 2056 2056 2056) |
539 ("grey3" 8 8 8) | 544 ("grey3" 2056 2056 2056) |
540 ("gray4" 10 10 10) | 545 ("gray4" 2570 2570 2570) |
541 ("grey4" 10 10 10) | 546 ("grey4" 2570 2570 2570) |
542 ("gray5" 13 13 13) | 547 ("gray5" 3341 3341 3341) |
543 ("grey5" 13 13 13) | 548 ("grey5" 3341 3341 3341) |
544 ("gray6" 15 15 15) | 549 ("gray6" 3855 3855 3855) |
545 ("grey6" 15 15 15) | 550 ("grey6" 3855 3855 3855) |
546 ("gray7" 18 18 18) | 551 ("gray7" 4626 4626 4626) |
547 ("grey7" 18 18 18) | 552 ("grey7" 4626 4626 4626) |
548 ("gray8" 20 20 20) | 553 ("gray8" 5140 5140 5140) |
549 ("grey8" 20 20 20) | 554 ("grey8" 5140 5140 5140) |
550 ("gray9" 23 23 23) | 555 ("gray9" 5911 5911 5911) |
551 ("grey9" 23 23 23) | 556 ("grey9" 5911 5911 5911) |
552 ("gray10" 26 26 26) | 557 ("gray10" 6682 6682 6682) |
553 ("grey10" 26 26 26) | 558 ("grey10" 6682 6682 6682) |
554 ("gray11" 28 28 28) | 559 ("gray11" 7196 7196 7196) |
555 ("grey11" 28 28 28) | 560 ("grey11" 7196 7196 7196) |
556 ("gray12" 31 31 31) | 561 ("gray12" 7967 7967 7967) |
557 ("grey12" 31 31 31) | 562 ("grey12" 7967 7967 7967) |
558 ("gray13" 33 33 33) | 563 ("gray13" 8481 8481 8481) |
559 ("grey13" 33 33 33) | 564 ("grey13" 8481 8481 8481) |
560 ("gray14" 36 36 36) | 565 ("gray14" 9252 9252 9252) |
561 ("grey14" 36 36 36) | 566 ("grey14" 9252 9252 9252) |
562 ("gray15" 38 38 38) | 567 ("gray15" 9766 9766 9766) |
563 ("grey15" 38 38 38) | 568 ("grey15" 9766 9766 9766) |
564 ("gray16" 41 41 41) | 569 ("gray16" 10537 10537 10537) |
565 ("grey16" 41 41 41) | 570 ("grey16" 10537 10537 10537) |
566 ("gray17" 43 43 43) | 571 ("gray17" 11051 11051 11051) |
567 ("grey17" 43 43 43) | 572 ("grey17" 11051 11051 11051) |
568 ("gray18" 46 46 46) | 573 ("gray18" 11822 11822 11822) |
569 ("grey18" 46 46 46) | 574 ("grey18" 11822 11822 11822) |
570 ("gray19" 48 48 48) | 575 ("gray19" 12336 12336 12336) |
571 ("grey19" 48 48 48) | 576 ("grey19" 12336 12336 12336) |
572 ("gray20" 51 51 51) | 577 ("gray20" 13107 13107 13107) |
573 ("grey20" 51 51 51) | 578 ("grey20" 13107 13107 13107) |
574 ("gray21" 54 54 54) | 579 ("gray21" 13878 13878 13878) |
575 ("grey21" 54 54 54) | 580 ("grey21" 13878 13878 13878) |
576 ("gray22" 56 56 56) | 581 ("gray22" 14392 14392 14392) |
577 ("grey22" 56 56 56) | 582 ("grey22" 14392 14392 14392) |
578 ("gray23" 59 59 59) | 583 ("gray23" 15163 15163 15163) |
579 ("grey23" 59 59 59) | 584 ("grey23" 15163 15163 15163) |
580 ("gray24" 61 61 61) | 585 ("gray24" 15677 15677 15677) |
581 ("grey24" 61 61 61) | 586 ("grey24" 15677 15677 15677) |
582 ("gray25" 64 64 64) | 587 ("gray25" 16448 16448 16448) |
583 ("grey25" 64 64 64) | 588 ("grey25" 16448 16448 16448) |
584 ("gray26" 66 66 66) | 589 ("gray26" 16962 16962 16962) |
585 ("grey26" 66 66 66) | 590 ("grey26" 16962 16962 16962) |
586 ("gray27" 69 69 69) | 591 ("gray27" 17733 17733 17733) |
587 ("grey27" 69 69 69) | 592 ("grey27" 17733 17733 17733) |
588 ("gray28" 71 71 71) | 593 ("gray28" 18247 18247 18247) |
589 ("grey28" 71 71 71) | 594 ("grey28" 18247 18247 18247) |
590 ("gray29" 74 74 74) | 595 ("gray29" 19018 19018 19018) |
591 ("grey29" 74 74 74) | 596 ("grey29" 19018 19018 19018) |
592 ("gray30" 77 77 77) | 597 ("gray30" 19789 19789 19789) |
593 ("grey30" 77 77 77) | 598 ("grey30" 19789 19789 19789) |
594 ("gray31" 79 79 79) | 599 ("gray31" 20303 20303 20303) |
595 ("grey31" 79 79 79) | 600 ("grey31" 20303 20303 20303) |
596 ("gray32" 82 82 82) | 601 ("gray32" 21074 21074 21074) |
597 ("grey32" 82 82 82) | 602 ("grey32" 21074 21074 21074) |
598 ("gray33" 84 84 84) | 603 ("gray33" 21588 21588 21588) |
599 ("grey33" 84 84 84) | 604 ("grey33" 21588 21588 21588) |
600 ("gray34" 87 87 87) | 605 ("gray34" 22359 22359 22359) |
601 ("grey34" 87 87 87) | 606 ("grey34" 22359 22359 22359) |
602 ("gray35" 89 89 89) | 607 ("gray35" 22873 22873 22873) |
603 ("grey35" 89 89 89) | 608 ("grey35" 22873 22873 22873) |
604 ("gray36" 92 92 92) | 609 ("gray36" 23644 23644 23644) |
605 ("grey36" 92 92 92) | 610 ("grey36" 23644 23644 23644) |
606 ("gray37" 94 94 94) | 611 ("gray37" 24158 24158 24158) |
607 ("grey37" 94 94 94) | 612 ("grey37" 24158 24158 24158) |
608 ("gray38" 97 97 97) | 613 ("gray38" 24929 24929 24929) |
609 ("grey38" 97 97 97) | 614 ("grey38" 24929 24929 24929) |
610 ("gray39" 99 99 99) | 615 ("gray39" 25443 25443 25443) |
611 ("grey39" 99 99 99) | 616 ("grey39" 25443 25443 25443) |
612 ("gray40" 102 102 102) | 617 ("gray40" 26214 26214 26214) |
613 ("grey40" 102 102 102) | 618 ("grey40" 26214 26214 26214) |
614 ("gray41" 105 105 105) | 619 ("gray41" 26985 26985 26985) |
615 ("grey41" 105 105 105) | 620 ("grey41" 26985 26985 26985) |
616 ("gray42" 107 107 107) | 621 ("gray42" 27499 27499 27499) |
617 ("grey42" 107 107 107) | 622 ("grey42" 27499 27499 27499) |
618 ("gray43" 110 110 110) | 623 ("gray43" 28270 28270 28270) |
619 ("grey43" 110 110 110) | 624 ("grey43" 28270 28270 28270) |
620 ("gray44" 112 112 112) | 625 ("gray44" 28784 28784 28784) |
621 ("grey44" 112 112 112) | 626 ("grey44" 28784 28784 28784) |
622 ("gray45" 115 115 115) | 627 ("gray45" 29555 29555 29555) |
623 ("grey45" 115 115 115) | 628 ("grey45" 29555 29555 29555) |
624 ("gray46" 117 117 117) | 629 ("gray46" 30069 30069 30069) |
625 ("grey46" 117 117 117) | 630 ("grey46" 30069 30069 30069) |
626 ("gray47" 120 120 120) | 631 ("gray47" 30840 30840 30840) |
627 ("grey47" 120 120 120) | 632 ("grey47" 30840 30840 30840) |
628 ("gray48" 122 122 122) | 633 ("gray48" 31354 31354 31354) |
629 ("grey48" 122 122 122) | 634 ("grey48" 31354 31354 31354) |
630 ("gray49" 125 125 125) | 635 ("gray49" 32125 32125 32125) |
631 ("grey49" 125 125 125) | 636 ("grey49" 32125 32125 32125) |
632 ("gray50" 127 127 127) | 637 ("gray50" 32639 32639 32639) |
633 ("grey50" 127 127 127) | 638 ("grey50" 32639 32639 32639) |
634 ("gray51" 130 130 130) | 639 ("gray51" 33410 33410 33410) |
635 ("grey51" 130 130 130) | 640 ("grey51" 33410 33410 33410) |
636 ("gray52" 133 133 133) | 641 ("gray52" 34181 34181 34181) |
637 ("grey52" 133 133 133) | 642 ("grey52" 34181 34181 34181) |
638 ("gray53" 135 135 135) | 643 ("gray53" 34695 34695 34695) |
639 ("grey53" 135 135 135) | 644 ("grey53" 34695 34695 34695) |
640 ("gray54" 138 138 138) | 645 ("gray54" 35466 35466 35466) |
641 ("grey54" 138 138 138) | 646 ("grey54" 35466 35466 35466) |
642 ("gray55" 140 140 140) | 647 ("gray55" 35980 35980 35980) |
643 ("grey55" 140 140 140) | 648 ("grey55" 35980 35980 35980) |
644 ("gray56" 143 143 143) | 649 ("gray56" 36751 36751 36751) |
645 ("grey56" 143 143 143) | 650 ("grey56" 36751 36751 36751) |
646 ("gray57" 145 145 145) | 651 ("gray57" 37265 37265 37265) |
647 ("grey57" 145 145 145) | 652 ("grey57" 37265 37265 37265) |
648 ("gray58" 148 148 148) | 653 ("gray58" 38036 38036 38036) |
649 ("grey58" 148 148 148) | 654 ("grey58" 38036 38036 38036) |
650 ("gray59" 150 150 150) | 655 ("gray59" 38550 38550 38550) |
651 ("grey59" 150 150 150) | 656 ("grey59" 38550 38550 38550) |
652 ("gray60" 153 153 153) | 657 ("gray60" 39321 39321 39321) |
653 ("grey60" 153 153 153) | 658 ("grey60" 39321 39321 39321) |
654 ("gray61" 156 156 156) | 659 ("gray61" 40092 40092 40092) |
655 ("grey61" 156 156 156) | 660 ("grey61" 40092 40092 40092) |
656 ("gray62" 158 158 158) | 661 ("gray62" 40606 40606 40606) |
657 ("grey62" 158 158 158) | 662 ("grey62" 40606 40606 40606) |
658 ("gray63" 161 161 161) | 663 ("gray63" 41377 41377 41377) |
659 ("grey63" 161 161 161) | 664 ("grey63" 41377 41377 41377) |
660 ("gray64" 163 163 163) | 665 ("gray64" 41891 41891 41891) |
661 ("grey64" 163 163 163) | 666 ("grey64" 41891 41891 41891) |
662 ("gray65" 166 166 166) | 667 ("gray65" 42662 42662 42662) |
663 ("grey65" 166 166 166) | 668 ("grey65" 42662 42662 42662) |
664 ("gray66" 168 168 168) | 669 ("gray66" 43176 43176 43176) |
665 ("grey66" 168 168 168) | 670 ("grey66" 43176 43176 43176) |
666 ("gray67" 171 171 171) | 671 ("gray67" 43947 43947 43947) |
667 ("grey67" 171 171 171) | 672 ("grey67" 43947 43947 43947) |
668 ("gray68" 173 173 173) | 673 ("gray68" 44461 44461 44461) |
669 ("grey68" 173 173 173) | 674 ("grey68" 44461 44461 44461) |
670 ("gray69" 176 176 176) | 675 ("gray69" 45232 45232 45232) |
671 ("grey69" 176 176 176) | 676 ("grey69" 45232 45232 45232) |
672 ("gray70" 179 179 179) | 677 ("gray70" 46003 46003 46003) |
673 ("grey70" 179 179 179) | 678 ("grey70" 46003 46003 46003) |
674 ("gray71" 181 181 181) | 679 ("gray71" 46517 46517 46517) |
675 ("grey71" 181 181 181) | 680 ("grey71" 46517 46517 46517) |
676 ("gray72" 184 184 184) | 681 ("gray72" 47288 47288 47288) |
677 ("grey72" 184 184 184) | 682 ("grey72" 47288 47288 47288) |
678 ("gray73" 186 186 186) | 683 ("gray73" 47802 47802 47802) |
679 ("grey73" 186 186 186) | 684 ("grey73" 47802 47802 47802) |
680 ("gray74" 189 189 189) | 685 ("gray74" 48573 48573 48573) |
681 ("grey74" 189 189 189) | 686 ("grey74" 48573 48573 48573) |
682 ("gray75" 191 191 191) | 687 ("gray75" 49087 49087 49087) |
683 ("grey75" 191 191 191) | 688 ("grey75" 49087 49087 49087) |
684 ("gray76" 194 194 194) | 689 ("gray76" 49858 49858 49858) |
685 ("grey76" 194 194 194) | 690 ("grey76" 49858 49858 49858) |
686 ("gray77" 196 196 196) | 691 ("gray77" 50372 50372 50372) |
687 ("grey77" 196 196 196) | 692 ("grey77" 50372 50372 50372) |
688 ("gray78" 199 199 199) | 693 ("gray78" 51143 51143 51143) |
689 ("grey78" 199 199 199) | 694 ("grey78" 51143 51143 51143) |
690 ("gray79" 201 201 201) | 695 ("gray79" 51657 51657 51657) |
691 ("grey79" 201 201 201) | 696 ("grey79" 51657 51657 51657) |
692 ("gray80" 204 204 204) | 697 ("gray80" 52428 52428 52428) |
693 ("grey80" 204 204 204) | 698 ("grey80" 52428 52428 52428) |
694 ("gray81" 207 207 207) | 699 ("gray81" 53199 53199 53199) |
695 ("grey81" 207 207 207) | 700 ("grey81" 53199 53199 53199) |
696 ("gray82" 209 209 209) | 701 ("gray82" 53713 53713 53713) |
697 ("grey82" 209 209 209) | 702 ("grey82" 53713 53713 53713) |
698 ("gray83" 212 212 212) | 703 ("gray83" 54484 54484 54484) |
699 ("grey83" 212 212 212) | 704 ("grey83" 54484 54484 54484) |
700 ("gray84" 214 214 214) | 705 ("gray84" 54998 54998 54998) |
701 ("grey84" 214 214 214) | 706 ("grey84" 54998 54998 54998) |
702 ("gray85" 217 217 217) | 707 ("gray85" 55769 55769 55769) |
703 ("grey85" 217 217 217) | 708 ("grey85" 55769 55769 55769) |
704 ("gray86" 219 219 219) | 709 ("gray86" 56283 56283 56283) |
705 ("grey86" 219 219 219) | 710 ("grey86" 56283 56283 56283) |
706 ("gray87" 222 222 222) | 711 ("gray87" 57054 57054 57054) |
707 ("grey87" 222 222 222) | 712 ("grey87" 57054 57054 57054) |
708 ("gray88" 224 224 224) | 713 ("gray88" 57568 57568 57568) |
709 ("grey88" 224 224 224) | 714 ("grey88" 57568 57568 57568) |
710 ("gray89" 227 227 227) | 715 ("gray89" 58339 58339 58339) |
711 ("grey89" 227 227 227) | 716 ("grey89" 58339 58339 58339) |
712 ("gray90" 229 229 229) | 717 ("gray90" 58853 58853 58853) |
713 ("grey90" 229 229 229) | 718 ("grey90" 58853 58853 58853) |
714 ("gray91" 232 232 232) | 719 ("gray91" 59624 59624 59624) |
715 ("grey91" 232 232 232) | 720 ("grey91" 59624 59624 59624) |
716 ("gray92" 235 235 235) | 721 ("gray92" 60395 60395 60395) |
717 ("grey92" 235 235 235) | 722 ("grey92" 60395 60395 60395) |
718 ("gray93" 237 237 237) | 723 ("gray93" 60909 60909 60909) |
719 ("grey93" 237 237 237) | 724 ("grey93" 60909 60909 60909) |
720 ("gray94" 240 240 240) | 725 ("gray94" 61680 61680 61680) |
721 ("grey94" 240 240 240) | 726 ("grey94" 61680 61680 61680) |
722 ("gray95" 242 242 242) | 727 ("gray95" 62194 62194 62194) |
723 ("grey95" 242 242 242) | 728 ("grey95" 62194 62194 62194) |
724 ("gray96" 245 245 245) | 729 ("gray96" 62965 62965 62965) |
725 ("grey96" 245 245 245) | 730 ("grey96" 62965 62965 62965) |
726 ("gray97" 247 247 247) | 731 ("gray97" 63479 63479 63479) |
727 ("grey97" 247 247 247) | 732 ("grey97" 63479 63479 63479) |
728 ("gray98" 250 250 250) | 733 ("gray98" 64250 64250 64250) |
729 ("grey98" 250 250 250) | 734 ("grey98" 64250 64250 64250) |
730 ("gray99" 252 252 252) | 735 ("gray99" 64764 64764 64764) |
731 ("grey99" 252 252 252) | 736 ("grey99" 64764 64764 64764) |
732 ("gray100" 255 255 255) | 737 ("gray100" 65535 65535 65535) |
733 ("grey100" 255 255 255) | 738 ("grey100" 65535 65535 65535) |
734 ("darkgrey" 169 169 169) | 739 ("darkgrey" 43433 43433 43433) |
735 ("darkgray" 169 169 169) | 740 ("darkgray" 43433 43433 43433) |
736 ("darkblue" 0 0 139) | 741 ("darkblue" 0 0 35723) |
737 ("darkcyan" 0 139 139) ; no "lightmagenta", see the comment above | 742 ("darkcyan" 0 35723 35723) ; no "lightmagenta", see comment above |
738 ("darkmagenta" 139 0 139) | 743 ("darkmagenta" 35723 0 35723) |
739 ("darkred" 139 0 0) ; but no "lightred", see the comment above | 744 ("darkred" 35723 0 0) ; but no "lightred", see comment above |
740 ("lightgreen" 144 238 144)) | 745 ("lightgreen" 37008 61166 37008)) |
741 "An alist of X color names and associated 8-bit RGB values.") | 746 "An alist of X color names and associated 16-bit RGB values.") |
742 | 747 |
743 (defvar tty-standard-colors | 748 (defvar tty-standard-colors |
744 '(("black" 0 0 0 0) | 749 '(("black" 0 0 0 0) |
745 ("red" 1 65535 0 0) | 750 ("red" 1 65535 0 0) |
746 ("green" 2 0 65535 0) | 751 ("green" 2 0 65535 0) |
819 (clear-face-cache))) | 824 (clear-face-cache))) |
820 | 825 |
821 (defun tty-color-canonicalize (color) | 826 (defun tty-color-canonicalize (color) |
822 "Return COLOR in canonical form. | 827 "Return COLOR in canonical form. |
823 A canonicalized color name is all-lower case, with any blanks removed." | 828 A canonicalized color name is all-lower case, with any blanks removed." |
824 (let ((color (downcase color))) | 829 (let ((case-fold-search nil)) |
825 (while (string-match " +" color) | 830 (if (string-match "[A-Z ]" color) |
826 (setq color (replace-match "" nil nil color))) | 831 (replace-regexp-in-string " +" "" (downcase color)) |
827 color)) | 832 color))) |
828 | 833 |
829 (defun tty-color-define (name index &optional rgb frame) | 834 (defun tty-color-define (name index &optional rgb frame) |
830 "Specify a tty color by its NAME, terminal INDEX and RGB values. | 835 "Specify a tty color by its NAME, terminal INDEX and RGB values. |
831 NAME is a string, INDEX is typically a small integer used to send to | 836 NAME is a string, INDEX is typically a small integer used to send to |
832 the terminal driver a command to switch this color on, and RGB is a | 837 the terminal driver a command to switch this color on, and RGB is a |
859 (if (< mag 1) 0 (acos (/ (+ r g b) mag))))) | 864 (if (< mag 1) 0 (acos (/ (+ r g b) mag))))) |
860 | 865 |
861 (defun tty-color-approximate (rgb &optional frame) | 866 (defun tty-color-approximate (rgb &optional frame) |
862 "Given a list of 3 rgb values in RGB, find the color in `tty-color-alist' | 867 "Given a list of 3 rgb values in RGB, find the color in `tty-color-alist' |
863 which is the best approximation in the 3-dimensional RGB space, | 868 which is the best approximation in the 3-dimensional RGB space, |
864 and return the index associated with the approximating color. | 869 and return its description. |
865 Each value of the RGB triplet has to be scaled to the 0..255 range. | 870 |
871 Value is a list of the form \(NAME INDEX R G B\). Note that the returned | |
872 NAME is not necessarily the same string as the argument COLOR, because | |
873 the latter might need to be approximated if it is not supported directly. | |
874 | |
875 Each value of the RGB triplet should be in the range 0..65535 range. | |
866 FRAME defaults to the selected frame." | 876 FRAME defaults to the selected frame." |
867 (let* ((color-list (tty-color-alist frame)) | 877 (let* ((color-list (tty-color-alist frame)) |
868 (candidate (car color-list)) | 878 (candidate (car color-list)) |
869 (best-distance 195076) ;; 3 * 255^2 + 15 | 879 (best-distance 195076) ;; 3 * 255^2 + 15 |
880 (r (ash (car rgb) -8)) | |
881 (g (ash (cadr rgb) -8)) | |
882 (b (ash (nth 2 rgb) -8)) | |
870 best-color) | 883 best-color) |
871 (while candidate | 884 (while candidate |
872 (let* ((try-rgb (cddr candidate)) | 885 (let ((try-rgb (cddr candidate)) |
873 (r (car rgb)) | 886 ;; If the approximated color is not close enough to the |
874 (g (cadr rgb)) | 887 ;; gray diagonal of the RGB cube, favor non-gray colors. |
875 (b (nth 2 rgb)) | 888 ;; (The number 0.065 is an empirical ad-hoc'ery.) |
876 ;; If the approximated color is not close enough to the | 889 (favor-non-gray (>= (tty-color-off-gray-diag r g b) 0.065)) |
877 ;; gray diagonal of the RGB cube, favor non-gray colors. | 890 try-r try-g try-b |
878 ;; (The number 0.065 is an empirical ad-hoc'ery.) | 891 dif-r dif-g dif-b dist) |
879 (favor-non-gray (>= (tty-color-off-gray-diag r g b) 0.065)) | |
880 try-r try-g try-b | |
881 dif-r dif-g dif-b dist) | |
882 ;; If the RGB values of the candidate color are unknown, we | 892 ;; If the RGB values of the candidate color are unknown, we |
883 ;; never consider it for approximating another color. | 893 ;; never consider it for approximating another color. |
884 (if try-rgb | 894 (if try-rgb |
885 (progn | 895 (progn |
886 (setq try-r (lsh (car try-rgb) -8) | 896 (setq try-r (lsh (car try-rgb) -8) |
887 try-g (lsh (cadr try-rgb) -8) | 897 try-g (lsh (cadr try-rgb) -8) |
888 try-b (lsh (nth 2 try-rgb) -8)) | 898 try-b (lsh (nth 2 try-rgb) -8)) |
889 (setq dif-r (- (car rgb) try-r) | 899 (setq dif-r (- r try-r) |
890 dif-g (- (cadr rgb) try-g) | 900 dif-g (- g try-g) |
891 dif-b (- (nth 2 rgb) try-b)) | 901 dif-b (- b try-b)) |
892 (setq dist (+ (* dif-r dif-r) (* dif-g dif-g) (* dif-b dif-b))) | 902 (setq dist (+ (* dif-r dif-r) (* dif-g dif-g) (* dif-b dif-b))) |
893 (if (and (< dist best-distance) | 903 (if (and (< dist best-distance) |
894 ;; The candidate color is on the gray diagonal | 904 ;; The candidate color is on the gray diagonal |
895 ;; if its RGB components are all equal. | 905 ;; if its RGB components are all equal. |
896 (or (/= try-r try-g) (/= try-g try-b) | 906 (or (/= try-r try-g) (/= try-g try-b) |
897 (not favor-non-gray))) | 907 (not favor-non-gray))) |
898 (setq best-distance dist | 908 (setq best-distance dist |
899 best-color candidate))))) | 909 best-color candidate))))) |
900 (setq color-list (cdr color-list)) | 910 (setq color-list (cdr color-list)) |
901 (setq candidate (car color-list))) | 911 (setq candidate (car color-list))) |
902 (cadr best-color))) | 912 best-color)) |
913 | |
914 (defun tty-color-standard-values (color) | |
915 "Return standard RGB values of the color COLOR. | |
916 | |
917 The result is a list of integer RGB values--(RED GREEN BLUE). | |
918 These values range from 0 to 65535; white is (65535 65535 65535). | |
919 | |
920 The returned value reflects the standard X definition of COLOR, | |
921 regardless of whether the terminal can display it, so the return value | |
922 should be the same regardless of what display is being used." | |
923 (let ((len (length color))) | |
924 (cond ((and (>= len 4) ;; X-style "#XXYYZZ" color spec | |
925 (eq (aref color 0) ?#) | |
926 (member (aref color 1) | |
927 '(?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9 | |
928 ?a ?b ?c ?d ?e ?f))) | |
929 ;; Translate the string "#XXYYZZ" into a list | |
930 ;; of numbers (XX YY ZZ). If the primary colors | |
931 ;; are specified with less than 4 hex digits, | |
932 ;; the used digits represent the most significant | |
933 ;; bits of the value (e.g. #XYZ = #X000Y000Z000). | |
934 (let* ((ndig (/ (- len 1) 3)) | |
935 (i1 1) | |
936 (i2 (+ i1 ndig)) | |
937 (i3 (+ i2 ndig))) | |
938 (list | |
939 (lsh | |
940 (string-to-number (substring color i1 i2) 16) | |
941 (* 4 (- 4 ndig))) | |
942 (lsh | |
943 (string-to-number (substring color i2 i3) 16) | |
944 (* 4 (- 4 ndig))) | |
945 (lsh | |
946 (string-to-number (substring color i3) 16) | |
947 (* 4 (- 4 ndig)))))) | |
948 ((and (>= len 9) ;; X-style RGB:xx/yy/zz color spec | |
949 (string= (substring color 0 4) "rgb:")) | |
950 ;; Translate the string "RGB:XX/YY/ZZ" into a list | |
951 ;; of numbers (XX YY ZZ). If fewer than 4 hex | |
952 ;; digits are used, they represent the fraction | |
953 ;; of the maximum value (RGB:X/Y/Z = #XXXXYYYYZZZZ). | |
954 (let* ((ndig (/ (- len 3) 3)) | |
955 (maxval (1- (ash 1 (* 4 (- ndig 1))))) | |
956 (i1 4) | |
957 (i2 (+ i1 ndig)) | |
958 (i3 (+ i2 ndig))) | |
959 (list | |
960 (/ (* (string-to-number | |
961 (substring color i1 (- i2 1)) 16) | |
962 255) | |
963 maxval) | |
964 (/ (* (string-to-number | |
965 (substring color i2 (- i3 1)) 16) | |
966 255) | |
967 maxval) | |
968 (/ (* (string-to-number | |
969 (substring color i3) 16) | |
970 255) | |
971 maxval)))) | |
972 (t | |
973 (cdr (assoc color color-name-rgb-alist)))))) | |
903 | 974 |
904 (defun tty-color-translate (color &optional frame) | 975 (defun tty-color-translate (color &optional frame) |
905 "Given a color COLOR, return the index of the corresponding TTY color. | 976 "Given a color COLOR, return the index of the corresponding TTY color. |
906 | 977 |
907 COLOR must be a string that is either the color's name, or its X-style | 978 COLOR must be a string that is either the color's name, or its X-style |
916 space. | 987 space. |
917 If COLOR is neither a valid X RGB specification of the color, nor a | 988 If COLOR is neither a valid X RGB specification of the color, nor a |
918 name of a color in `color-name-rgb-alist', the returned value is nil. | 989 name of a color in `color-name-rgb-alist', the returned value is nil. |
919 | 990 |
920 If FRAME is unspecified or nil, it defaults to the selected frame." | 991 If FRAME is unspecified or nil, it defaults to the selected frame." |
921 (and (stringp color) | 992 (cadr (tty-color-desc color frame))) |
922 (let* ((color (tty-color-canonicalize color)) | |
923 (idx (cadr (assoc color (tty-color-alist frame))))) | |
924 (or idx | |
925 (let* ((len (length color)) | |
926 (maxval 256) | |
927 (rgb | |
928 (cond | |
929 ((and (>= len 4) ;; X-style "#XXYYZZ" color spec | |
930 (eq (aref color 0) ?#) | |
931 (member (aref color 1) | |
932 '(?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9 | |
933 ?a ?b ?c ?d ?e ?f))) | |
934 ;; Translate the string "#XXYYZZ" into a list | |
935 ;; of numbers (XX YY ZZ). If the primary colors | |
936 ;; are specified with less than 4 hex digits, | |
937 ;; the used digits represent the most significant | |
938 ;; bits of the value (e.g. #XYZ = #X000Y000Z000). | |
939 (let* ((ndig (/ (- len 1) 3)) | |
940 (i1 1) | |
941 (i2 (+ i1 ndig)) | |
942 (i3 (+ i2 ndig))) | |
943 (list | |
944 (lsh | |
945 (string-to-number (substring color i1 i2) 16) | |
946 (* 4 (- 2 ndig))) | |
947 (lsh | |
948 (string-to-number (substring color i2 i3) 16) | |
949 (* 4 (- 2 ndig))) | |
950 (lsh | |
951 (string-to-number (substring color i3) 16) | |
952 (* 4 (- 2 ndig)))))) | |
953 ((and (>= len 9) ;; X-style RGB:xx/yy/zz color spec | |
954 (string= (substring color 0 4) "rgb:")) | |
955 ;; Translate the string "RGB:XX/YY/ZZ" into a list | |
956 ;; of numbers (XX YY ZZ). If fewer than 4 hex | |
957 ;; digits are used, they represent the fraction | |
958 ;; of the maximum value (RGB:X/Y/Z = #XXXXYYYYZZZZ). | |
959 (let* ((ndig (/ (- len 3) 3)) | |
960 (maxval (1- (expt 16 (- ndig 1)))) | |
961 (i1 4) | |
962 (i2 (+ i1 ndig)) | |
963 (i3 (+ i2 ndig))) | |
964 (list | |
965 (/ (* (string-to-number | |
966 (substring color i1 (- i2 1)) 16) | |
967 255) | |
968 maxval) | |
969 (/ (* (string-to-number | |
970 (substring color i2 (- i3 1)) 16) | |
971 255) | |
972 maxval) | |
973 (/ (* (string-to-number | |
974 (substring color i3) 16) | |
975 255) | |
976 maxval)))) | |
977 (t | |
978 (cdr (assoc color color-name-rgb-alist)))))) | |
979 (and rgb (tty-color-approximate rgb frame))))))) | |
980 | 993 |
981 (defun tty-color-by-index (idx &optional frame) | 994 (defun tty-color-by-index (idx &optional frame) |
982 "Given a numeric index of a tty color, return its description. | 995 "Given a numeric index of a tty color, return its description. |
983 | 996 |
984 FRAME, if unspecified or nil, defaults to the selected frame. | 997 FRAME, if unspecified or nil, defaults to the selected frame. |
999 If COLOR is not directly supported by the display, return the RGB | 1012 If COLOR is not directly supported by the display, return the RGB |
1000 values for a supported color that is its best approximation. | 1013 values for a supported color that is its best approximation. |
1001 The value is a list of integer RGB values--\(RED GREEN BLUE\). | 1014 The value is a list of integer RGB values--\(RED GREEN BLUE\). |
1002 These values range from 0 to 65535; white is (65535 65535 65535). | 1015 These values range from 0 to 65535; white is (65535 65535 65535). |
1003 If FRAME is omitted or nil, use the selected frame." | 1016 If FRAME is omitted or nil, use the selected frame." |
1004 (let* ((frame (or frame (selected-frame))) | 1017 (cddr (tty-color-desc color frame))) |
1005 (color (tty-color-canonicalize color)) | |
1006 (supported (assoc color (tty-color-alist frame)))) | |
1007 (or (and supported (cddr supported)) ; full spec in tty-color-alist | |
1008 (and supported ; no RGB values in tty-color-alist: use X RGB values | |
1009 (assoc color color-name-rgb-alist) | |
1010 (cddr | |
1011 (tty-color-by-index | |
1012 (tty-color-approximate | |
1013 (cdr (assoc color color-name-rgb-alist)) frame) frame))) | |
1014 (cddr (tty-color-by-index (tty-color-translate color frame) frame))))) | |
1015 | 1018 |
1016 (defun tty-color-desc (color &optional frame) | 1019 (defun tty-color-desc (color &optional frame) |
1017 "Return the description of the color COLOR for a character terminal. | 1020 "Return the description of the color COLOR for a character terminal. |
1018 | 1021 Value is a list of the form \(NAME INDEX R G B\). The returned NAME or |
1019 FRAME, if unspecified or nil, defaults to the selected frame. | 1022 RGB value may not be the same as the argument COLOR, because the latter |
1020 Value is a list of the form \(NAME INDEX R G B\). Note that the returned | 1023 might need to be approximated if it is not supported directly." |
1021 NAME is not necessarily the same string as the argument COLOR, because | 1024 (and (stringp color) |
1022 the latter might need to be approximated if it is not supported directly." | 1025 (let ((color (tty-color-canonicalize color))) |
1023 (let ((idx (tty-color-translate color frame))) | 1026 (or (assoc color (tty-color-alist frame)) |
1024 (tty-color-by-index idx frame))) | 1027 (let ((rgb (tty-color-standard-values color))) |
1028 (and rgb (tty-color-approximate rgb frame))))))) | |
1025 | 1029 |
1026 (defun tty-color-gray-shades (&optional display) | 1030 (defun tty-color-gray-shades (&optional display) |
1027 "Return the number of gray colors supported by DISPLAY's terminal. | 1031 "Return the number of gray colors supported by DISPLAY's terminal. |
1028 A color is considered gray if the 3 components of its RGB value are equal." | 1032 A color is considered gray if the 3 components of its RGB value are equal." |
1029 (let* ((frame (if (framep display) display | 1033 (let* ((frame (if (framep display) display |