]> code.delx.au - gnu-emacs/commitdiff
color-hsl-to-rgb fix (tiny change)
authorJulian Scheid <julians37@gmail.com>
Sat, 6 Oct 2012 02:20:36 +0000 (19:20 -0700)
committerGlenn Morris <rgm@gnu.org>
Sat, 6 Oct 2012 02:20:36 +0000 (19:20 -0700)
* lisp/color.el (color-hsl-to-rgb): Fix incorrect results for small
and large hue values.

Fixes: debbugs:12559
lisp/ChangeLog
lisp/color.el

index 1010fc0ae11a4cdada3055d0b9a4ce4d5ceea2c1..861022aae88c911df717f90444ec6b8004d40e75 100644 (file)
@@ -1,3 +1,8 @@
+2012-10-06  Julian Scheid  <julians37@gmail.com>  (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  <fgallina@cuca>
 
        Enhancements to docstring formatting when filling paragraphs.
index f618d47a54055f9f57e5e2890359a73a873815e8..b915beacb0a2aa4bea3f796227469c34d8f26c22 100644 (file)
@@ -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."