GNU bug report logs - #12558
Incorrect docstrings for color-rgb-to-hsl and color-hsl-to-rgb

Previous Next

Package: emacs;

Reported by: Julian Scheid <julians37 <at> gmail.com>

Date: Tue, 2 Oct 2012 16:27:03 UTC

Severity: minor

Fixed in version 24.3

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 12558 in the body.
You can then email your comments to 12558 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#12558; Package emacs. (Tue, 02 Oct 2012 16:27:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Julian Scheid <julians37 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 02 Oct 2012 16:27:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Julian Scheid <julians37 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Incorrect docstrings for color-rgb-to-hsl and color-hsl-to-rgb
Date: Tue, 02 Oct 2012 14:43:36 +0200
The docstrings for `color-rgb-to-hsl' and `color-hsl-to-rgb' both state
that the HUE component is given in radians, but in fact it's in range
0..1 in both cases.

It's easy to see that the value returned by `color-rgb-to-hsl' for hue
is the result of (mod N 1.0), and `color-hsl-to-rgb' uses the same
representation:

    (apply 'color-hsl-to-rgb
           (color-rgb-to-hsl 0.7 0.8 0.9))
    ;; -> (0.7000000000000001 0.7999999999999999 0.9)


2012-10-02  Julian Scheid  <julians37 <at> gmail.com>

	* color.el (color-rgb-to-hsl, color-hsl-to-rgb): Fix docstring.


=== modified file 'lisp/color.el'
*** lisp/color.el	2012-08-13 19:10:35 +0000
--- lisp/color.el	2012-10-02 11:49:04 +0000
*************** resulting list."
*** 102,110 ****
     (t                 v1)))
  
  (defun color-hsl-to-rgb (H S L)
!     "Convert H S L (HUE, SATURATION, LUMINANCE) , where HUE is in
! radians and both SATURATION and LUMINANCE are between 0.0 and
! 1.0, inclusive to their RGB representation.
  
  Return a list (RED, GREEN, BLUE) which each be numbers between
  0.0 and 1.0, inclusive."
--- 102,110 ----
     (t                 v1)))
  
  (defun color-hsl-to-rgb (H S L)
!   "Convert H S L (HUE, SATURATION, LUMINANCE), where H S L should
! each be numbers between 0.0 and 1.0 inclusive, to their RGB
! representation.
  
  Return a list (RED, GREEN, BLUE) which each be numbers between
  0.0 and 1.0, inclusive."
*************** inclusive."
*** 159,167 ****
  RED, GREEN, and BLUE should each be numbers between 0.0 and 1.0,
  inclusive.
  
! Return a list (HUE, SATURATION, LUMINANCE), where HUE is in radians
! and both SATURATION and LUMINANCE are between 0.0 and 1.0,
! inclusive."
    (let* ((r red)
           (g green)
           (b blue)
--- 159,166 ----
  RED, GREEN, and BLUE should each be numbers between 0.0 and 1.0,
  inclusive.
  
! Return a list (HUE, SATURATION, LUMINANCE) which each be numbers
! between 0.0 and 1.0, inclusive."
    (let* ((r red)
           (g green)
           (b blue)




Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Fri, 05 Oct 2012 07:19:02 GMT) Full text and rfc822 format available.

Notification sent to Julian Scheid <julians37 <at> gmail.com>:
bug acknowledged by developer. (Fri, 05 Oct 2012 07:19:02 GMT) Full text and rfc822 format available.

Message #10 received at 12558-done <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 12558-done <at> debbugs.gnu.org
Subject: Re: bug#12558: Incorrect docstrings for color-rgb-to-hsl and
	color-hsl-to-rgb
Date: Fri, 05 Oct 2012 03:18:20 -0400
Version: 24.3

Thanks; corrected in emacs-24 branch.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 02 Nov 2012 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 203 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.