Subject: Re: bug#22343: 25.0.50; Incorrect rounding (?) when loading the Emacs.background attribute from Xresources

From: Clément Pit--Claudel <[email-masked]>
Date: Mon, 11 Jan 2016 14:09:53 -0500

On 01/11/2016 01:56 PM, Eli Zaretskii wrote:
>> From: Clément Pit--Claudel <[email-masked]>
>> Date: Sun, 10 Jan 2016 16:19:50 -0500
>>
>> This is a cute bug. Run the following two commands (in bash):
>>
>> # Set Emacs.background in Xresources
>> $ xrdb <(echo "Emacs.background: #2e3436")
>> # Run Emacs with same background on default face
>> $ emacs -q --eval "(set-face-attribute 'default nil :background \"#2e3436\")"
>>
>> On my machine, the two colors are not rendered the same. I've attached a screenshot. What essentially happens is that anywhere where text is drawn the background is indeed #2e3436, but on the rest of the frame it's #2d3335. Amusingly, these two colors have distinct RGB and HSL values, but their CMYK and HSB values are the same (or so says http://rgb.to/hex/2d3335 and http://rgb.to/hex/2e3436, at least).
>>
>> The reason I came across this is that I use Emacs' tango-dark theme, which uses that background color. Since I didn't like Emacs popping up with a white background and immediately switching, I set the same background in my .Xresources.
>>
>> To observe the bug more clearly, just take a screenshot and open it in your favourite image editor, then use the magic wand with a tolerance of 0 (see other screenshot). Or use the color picker.
>>
>> What could cause this problem? A roundtripping issue with color conversions?
> 
> Could this be the distant-background feature at work?

I don't know :) How can I check? I was not aware of the distant-background feature; I'm only familiar with distant-foreground.

Clément.