[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r111485: color.el: fix color-rgb-to-h
From: |
Katsumi Yamaoka |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r111485: color.el: fix color-rgb-to-hsv computing |
Date: |
Fri, 11 Jan 2013 15:04:24 +0000 |
User-agent: |
Bazaar (2.5.0) |
------------------------------------------------------------
revno: 111485
author: Julien Danjou <address@hidden>
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Fri 2013-01-11 15:04:24 +0000
message:
color.el: fix color-rgb-to-hsv computing
modified:
lisp/ChangeLog
lisp/color.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2013-01-11 10:40:54 +0000
+++ b/lisp/ChangeLog 2013-01-11 15:04:24 +0000
@@ -1,3 +1,9 @@
+2013-01-11 Julien Danjou <address@hidden>
+
+ * color.el (color-rgb-to-hsv): Fix conversion computing in case min and
+ max are almost equal. Also return the correct value for V which is
+ already between 0 and 1.
+
2013-01-11 Dmitry Antipov <address@hidden>
* emacs-lisp/ert.el (ert-run-test): Use point-max-marker.
=== modified file 'lisp/color.el'
--- a/lisp/color.el 2013-01-02 16:13:04 +0000
+++ b/lisp/color.el 2013-01-11 15:04:24 +0000
@@ -130,7 +130,7 @@
(max (max r g b))
(min (min r g b)))
(if (< (- max min) 1e-8)
- (list 0.0 0.0 0.0)
+ (list 0.0 0.0 min)
(list
(/ (* 2 float-pi
(cond ((and (= r g) (= g b)) 0)
@@ -146,7 +146,7 @@
(+ 240 (* 60 (/ (- r g) (- max min)))))))
360)
(if (= max 0) 0 (- 1 (/ min max)))
- (/ max 255.0)))))
+ max))))
(defun color-rgb-to-hsl (red green blue)
"Convert RGB colors to their HSL representation.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r111485: color.el: fix color-rgb-to-hsv computing,
Katsumi Yamaoka <=