X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;ds=sidebyside;f=lisp%2Fshr-color.el;h=afb56ae38a70f7a0d43332ac31adc564f2212e3a;hb=400a77ad86dccb7c5c4904162d18aa7716f9470f;hp=3346b43d96495f2effc90bb4972137e0bcd29761;hpb=64ee11dd46b931a4e3db860675bf970c36e9c7e6;p=gnus diff --git a/lisp/shr-color.el b/lisp/shr-color.el index 3346b43d9..afb56ae38 100644 --- a/lisp/shr-color.el +++ b/lisp/shr-color.el @@ -27,6 +27,7 @@ ;;; Code: (require 'color) +(eval-when-compile (require 'cl)) (defgroup shr-color nil "Simple HTML Renderer colors" @@ -329,8 +330,8 @@ color will be adapted to be visible on BG." (if (or (null fg-norm) (null bg-norm)) (list bg fg) - (let* ((fg-lab (apply 'color-rgb->lab fg-norm)) - (bg-lab (apply 'color-rgb->lab bg-norm)) + (let* ((fg-lab (apply 'color-srgb->lab fg-norm)) + (bg-lab (apply 'color-srgb->lab bg-norm)) ;; Compute color distance using CIE DE 2000 (fg-bg-distance (color-cie-de2000 fg-lab bg-lab)) ;; Compute luminance distance (substract L component) @@ -350,10 +351,10 @@ color will be adapted to be visible on BG." bg (apply 'format "#%02x%02x%02x" (mapcar (lambda (x) (* (max (min 1 x) 0) 255)) - (apply 'color-lab->rgb bg-lab)))) + (apply 'color-lab->srgb bg-lab)))) (apply 'format "#%02x%02x%02x" (mapcar (lambda (x) (* (max (min 1 x) 0) 255)) - (apply 'color-lab->rgb fg-lab)))))))))) + (apply 'color-lab->srgb fg-lab)))))))))) (provide 'shr-color)