210 |
(setq colors (cdr colors) |
(setq colors (cdr colors) |
211 |
color (car colors) |
color (car colors) |
212 |
ncolors (1- ncolors))) |
ncolors (1- ncolors))) |
213 |
|
(when (and (> ncolors 0) (= ncolors 72)) ; rxvt-unicode |
214 |
|
;; 64 non-gray colors |
215 |
|
(let ((levels '(0 139 205 255)) |
216 |
|
(r 0) (g 0) (b 0)) |
217 |
|
(while (> ncolors 8) |
218 |
|
(tty-color-define (format "color-%d" (- 88 ncolors)) |
219 |
|
(- 88 ncolors) |
220 |
|
(mapcar 'rxvt-rgb-convert-to-16bit |
221 |
|
(list (nth r levels) |
222 |
|
(nth g levels) |
223 |
|
(nth b levels)))) |
224 |
|
(setq b (1+ b)) |
225 |
|
(if (> b 3) |
226 |
|
(setq g (1+ g) |
227 |
|
b 0)) |
228 |
|
(if (> g 3) |
229 |
|
(setq r (1+ r) |
230 |
|
g 0)) |
231 |
|
(setq ncolors (1- ncolors)))) |
232 |
|
;; Now the 8 gray colors |
233 |
|
(while (> ncolors 0) |
234 |
|
(setq color (rxvt-rgb-convert-to-16bit |
235 |
|
(floor |
236 |
|
(if (= ncolors 8) |
237 |
|
46.36363636 |
238 |
|
(+ (* (- 8 ncolors) 23.18181818) 69.54545454))))) |
239 |
|
(tty-color-define (format "color-%d" (- 88 ncolors)) |
240 |
|
(- 88 ncolors) |
241 |
|
(list color color color)) |
242 |
|
(setq ncolors (1- ncolors)))) |
243 |
;; Modifying color mappings means realized faces don't use the |
;; Modifying color mappings means realized faces don't use the |
244 |
;; right colors, so clear them. |
;; right colors, so clear them. |
245 |
(clear-face-cache))) |
(clear-face-cache))) |