summaryrefslogtreecommitdiff
path: root/lisp/net/shr-color.el
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-10-20 18:16:47 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2015-10-20 18:22:48 -0700
commite9af822ac3ddf9644aa4a68e56b0580e133449b2 (patch)
tree55b2ae836adac54903d43ee77e2730a0e2ac86bd /lisp/net/shr-color.el
parent513fe25a501b41f9f2aac67f73c8e8730aed81b0 (diff)
downloademacs-e9af822ac3ddf9644aa4a68e56b0580e133449b2.tar.gz
(/ N) now returns the reciprocal of N
This is more compatible with Common Lisp and XEmacs (Bug#21690). See: http://lists.gnu.org/archive/html/emacs-devel/2015-10/msg01053.html * lisp/color.el (color-hue-to-rgb, color-hsl-to-rgb) (color-xyz-to-srgb, color-xyz-to-lab): * lisp/emacs-lisp/cl-extra.el (cl-float-limits): * lisp/net/shr-color.el (shr-color-hue-to-rgb) (shr-color-hsl-to-rgb-fractions): Exploit the change to simplify the code a bit. * lisp/emacs-lisp/bytecomp.el (byte-compile-quo): Don’t complain about single-argument calls to ‘/’. * src/data.c (arith_driver, float_arith_driver): Implement the change.
Diffstat (limited to 'lisp/net/shr-color.el')
-rw-r--r--lisp/net/shr-color.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/net/shr-color.el b/lisp/net/shr-color.el
index 482f829707d..f8d358c27b3 100644
--- a/lisp/net/shr-color.el
+++ b/lisp/net/shr-color.el
@@ -211,7 +211,7 @@ This will convert \"80 %\" to 204, \"100 %\" to 255 but \"123\" to \"123\"."
"Convert X Y H to RGB value."
(when (< h 0) (incf h))
(when (> h 1) (decf h))
- (cond ((< h (/ 1 6.0)) (+ x (* (- y x) h 6)))
+ (cond ((< h (/ 6.0)) (+ x (* (- y x) h 6)))
((< h 0.5) y)
((< h (/ 2.0 3.0)) (+ x (* (- y x) (- (/ 2.0 3.0) h) 6)))
(t x)))
@@ -223,9 +223,9 @@ This will convert \"80 %\" to 204, \"100 %\" to 255 but \"123\" to \"123\"."
(setq m2 (* l (+ s 1)))
(setq m2 (- (+ l s) (* l s))))
(setq m1 (- (* l 2) m2))
- (list (shr-color-hue-to-rgb m1 m2 (+ h (/ 1 3.0)))
+ (list (shr-color-hue-to-rgb m1 m2 (+ h (/ 3.0)))
(shr-color-hue-to-rgb m1 m2 h)
- (shr-color-hue-to-rgb m1 m2 (- h (/ 1 3.0))))))
+ (shr-color-hue-to-rgb m1 m2 (- h (/ 3.0))))))
(defun shr-color->hexadecimal (color)
"Convert any color format to hexadecimal representation.