emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 5fcac7c: Fix a off-by-one error and some wording in rainbo


From: Julien Danjou
Subject: [elpa] master 5fcac7c: Fix a off-by-one error and some wording in rainbow-mode
Date: Mon, 25 Nov 2019 10:59:02 -0500 (EST)

branch: master
commit 5fcac7c578b64112c9194deb5e8a73d3658b4262
Author: Julien Danjou <address@hidden>
Commit: Julien Danjou <address@hidden>

    Fix a off-by-one error and some wording in rainbow-mode
    
    * packages/rainbow-mode/rainbow-mode.el (rainbow-color-luminance): Fix a
    off-by-one error and wording.
    (rainbow-x-color-luminance): Fix wording.
    
    Thanks Peder Stray.
---
 packages/rainbow-mode/rainbow-mode.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/packages/rainbow-mode/rainbow-mode.el 
b/packages/rainbow-mode/rainbow-mode.el
index 275ca86..084fcd4 100644
--- a/packages/rainbow-mode/rainbow-mode.el
+++ b/packages/rainbow-mode/rainbow-mode.el
@@ -1116,12 +1116,12 @@ If the percentage value is above 100, it's converted to 
100."
       (rainbow-colorize-match color))))
 
 (defun rainbow-color-luminance (red green blue)
-  "Calculate the luminance of color composed of RED, GREEN and BLUE.
+  "Calculate the relative luminance of color composed of RED, GREEN and BLUE.
 Return a value between 0 and 1."
-  (/ (+ (* .2126 red) (* .7152 green) (* .0722 blue)) 256))
+  (/ (+ (* .2126 red) (* .7152 green) (* .0722 blue)) 255))
 
 (defun rainbow-x-color-luminance (color)
-  "Calculate the luminance of a color string (e.g. \"#ffaa00\", \"blue\").
+  "Calculate the relative luminance of a color string (e.g. \"#ffaa00\", 
\"blue\").
 Return a value between 0 and 1."
   (let* ((values (x-color-values color))
          (r (/ (car values) 256.0))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]