From: Julian Scheid Date: Sat, 6 Oct 2012 02:20:36 +0000 (-0700) Subject: color-hsl-to-rgb fix (tiny change) X-Git-Tag: emacs-24.2.90~241^2~1 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=123ec157692a9e776056d66f447c5fee59b72b13;p=emacs.git color-hsl-to-rgb fix (tiny change) * lisp/color.el (color-hsl-to-rgb): Fix incorrect results for small and large hue values. Fixes: debbugs:12559 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1010fc0ae11..861022aae88 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-10-06 Julian Scheid (tiny change) + + * color.el (color-hsl-to-rgb): Fix incorrect results for + small and large hue values. (Bug#12559) + 2012-10-05 Fabián Ezequiel Gallina Enhancements to docstring formatting when filling paragraphs. diff --git a/lisp/color.el b/lisp/color.el index f618d47a540..b915beacb0a 100644 --- a/lisp/color.el +++ b/lisp/color.el @@ -113,9 +113,9 @@ inclusive." (- (+ L S) (* L S)))) (m1 (- (* 2.0 L) m2))) (list - (color-hue-to-rgb m1 m2 (+ H (/ 1.0 3))) + (color-hue-to-rgb m1 m2 (mod (+ H (/ 1.0 3)) 1)) (color-hue-to-rgb m1 m2 H) - (color-hue-to-rgb m1 m2 (- H (/ 1.0 3))))))) + (color-hue-to-rgb m1 m2 (mod (- H (/ 1.0 3)) 1)))))) (defun color-complement-hex (color) "Return the color that is the complement of COLOR, in hexadecimal format."