[gnus git] branch master updated: m0-5-249-g4d5210e =1= color: fix color-rgb-to-hsv computing

Julien Danjou <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  4d5210efac86cc8813b3d036fd008ab25ef53143 (commit)
      from  0abd8b04f1c3e1cbe29de65bd6f2b8eac9204ab9 (commit)


- Log -----------------------------------------------------------------
commit 4d5210efac86cc8813b3d036fd008ab25ef53143
Author: Julien Danjou <[email protected]>
Date:   Fri Jan 11 10:52:53 2013 +0100

    color: fix color-rgb-to-hsv computing
    
    Signed-off-by: Julien Danjou <[email protected]>

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 2ed5647..c6519ea 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2013-01-11  Julien Danjou  <[email protected]>
+
+	* 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-10  Uwe Brauer  <[email protected]>  (tiny change)
 
 	* mml-smime.el (mml-smime-encrypt-to-self): New user option analogous
diff --git a/lisp/color.el b/lisp/color.el
index 3b6e33c..6b60684 100644
--- a/lisp/color.el
+++ b/lisp/color.el
@@ -130,7 +130,7 @@ inclusive."
 	 (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 @@ inclusive."
 		    (+ 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.

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog |    6 ++++++
 lisp/color.el  |    4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.