From 123ec157692a9e776056d66f447c5fee59b72b13 Mon Sep 17 00:00:00 2001 From: Julian Scheid Date: Fri, 5 Oct 2012 19:20:36 -0700 Subject: [PATCH] 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 --- lisp/ChangeLog | 5 +++++ lisp/color.el | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) 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." -- 2.39.5