bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#25890: `color-values` gives wrong value


From: Drew Adams
Subject: bug#25890: `color-values` gives wrong value
Date: Tue, 28 Feb 2017 15:54:46 -0800 (PST)

> >  (defun color-rgb-to-hex  (red green blue)
> >    "Return hexadecimal notation for the color RED GREEN BLUE.
> >  RED, GREEN, and BLUE should be numbers between 0.0 and 1.0, inclusive."
> > -  (format "#%02x%02x%02x"
> > -          (* red 255) (* green 255) (* blue 255)))
> > +  (format "#%04x%04x%04x"
> > +          (* red 65535) (* green 65535) (* blue 65535)))

The function should accept an optional arg NB-DIGITS, which
specifies the number of hex digits for each of R, G, B.  And
yes, it should default to 4 digits: #RRRRGGGGBBBB.

(That's what the original function in hexrgb.el does, from
which color.el was supposedly derived.)





reply via email to

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