[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#25890: `color-values` gives wrong value
From: |
Rasmus |
Subject: |
bug#25890: `color-values` gives wrong value |
Date: |
Wed, 01 Mar 2017 10:55:22 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
Hi,
Eli Zaretskii <eliz@gnu.org> 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,
Rasmus
--
Hvor meget poesi tror De kommer ud af et glas isvand?
- bug#25890: `color-values` gives wrong value,
Rasmus <=