[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/term/rxvt.el
From: |
Dan Nicolaescu |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/term/rxvt.el |
Date: |
Sat, 24 Sep 2005 19:10:04 -0400 |
Index: emacs/lisp/term/rxvt.el
diff -c emacs/lisp/term/rxvt.el:1.12 emacs/lisp/term/rxvt.el:1.13
*** emacs/lisp/term/rxvt.el:1.12 Thu Sep 22 21:30:40 2005
--- emacs/lisp/term/rxvt.el Sat Sep 24 23:10:01 2005
***************
*** 210,215 ****
--- 210,245 ----
(setq colors (cdr colors)
color (car colors)
ncolors (1- ncolors)))
+ (when (and (> ncolors 0) (= ncolors 72)) ; rxvt-unicode
+ ;; 64 non-gray colors
+ (let ((levels '(0 139 205 255))
+ (r 0) (g 0) (b 0))
+ (while (> ncolors 8)
+ (tty-color-define (format "color-%d" (- 88 ncolors))
+ (- 88 ncolors)
+ (mapcar 'rxvt-rgb-convert-to-16bit
+ (list (nth r levels)
+ (nth g levels)
+ (nth b levels))))
+ (setq b (1+ b))
+ (if (> b 3)
+ (setq g (1+ g)
+ b 0))
+ (if (> g 3)
+ (setq r (1+ r)
+ g 0))
+ (setq ncolors (1- ncolors))))
+ ;; Now the 8 gray colors
+ (while (> ncolors 0)
+ (setq color (rxvt-rgb-convert-to-16bit
+ (floor
+ (if (= ncolors 8)
+ 46.36363636
+ (+ (* (- 8 ncolors) 23.18181818) 69.54545454)))))
+ (tty-color-define (format "color-%d" (- 88 ncolors))
+ (- 88 ncolors)
+ (list color color color))
+ (setq ncolors (1- ncolors))))
;; Modifying color mappings means realized faces don't use the
;; right colors, so clear them.
(clear-face-cache)))