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: Eli Zaretskii
Subject: bug#25890: `color-values` gives wrong value
Date: Fri, 03 Mar 2017 16:08:35 +0200

> From: Rasmus <address@hidden>
> Date: Wed, 01 Mar 2017 10:55:22 +0100
> 
> Eli Zaretskii <address@hidden> writes:
> 
> > I think there's a bug in color.el: it assumes that the #RGB notation
> > uses 24 bits, i.e. each component maxes out at 255.  But Emacs does
> > its color calculations based on 16-bit components, which max out at
> > 65535, which is why #ffffff does NOT produce (65535 65535 65535), the
> > white color.  (We decided long ago to use 16-bit components because X
> > APIs such as XParseColor on some systems, including yours, work with
> > such components.)  IOW, #ffffff is parsed as #ff00ff00ff00, and that
> > is not "white".
> >
> > So I think the patch below is what is needed to fix this problem.  Can
> > you try it?  (There's one user of the functions the patch changes,
> > shr-color.el, which will need to be adapted to the change, if we
> > decide to install it.)
> 
> The test I used before now works for me:
> 
>     (set-frame-parameter (selected-frame) 'background-color
>                          (color-darken-name "light yellow" 5))
> 
> Other noteworthy effects of the change were already addressed by Michael.

Thanks, I installed my change with minor variations, and I'm marking
this bug done.





reply via email to

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