GNU bug report logs - #8402
24.0.50; Hex colors are not rendered correctly on OS X (Cocoa)

Previous Next

Package: emacs;

Reported by: Steve Purcell <steve <at> sanityinc.com>

Date: Fri, 1 Apr 2011 10:02:01 UTC

Severity: normal

Tags: moreinfo

Found in version 24.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Steve Purcell <steve <at> sanityinc.com>
To: 8402 <at> debbugs.gnu.org
Subject: bug#8402: Acknowledgement (24.0.50; Hex colors are not rendered correctly on OS X (Cocoa))
Date: Wed, 4 May 2011 13:52:30 +0100
Chong Yidong wrote:
> On X, we just pass color names to Xlib functions like XParseColor as
> simple RGB, i.e. not specifying any particular color space, letting that
> be chosen by X.  I don't know how this choice is made; the Xlib docs
> simply say that the color space is device-dependent.  In general, I
> think we use whatever color space happens to be the system default.
> 
> I am not familiar with the code in question, but from what I can tell
> the NS code always uses NSCalibratedRGBColorSpace, which indicates that
> using colorWithCalibratedRed to specify RGB components ought to do the
> right thing.  I don't know why it doesn't.



Thinking about this, if XParseColor interprets the RGB value as a device-dependent color, then it seems Erik is right that the correct NS function to use would be colorWithDeviceRed, not colorWithCalibratedRed.

It feels right to me that when the user sees a color on his display and enters its hex code in his Emacs config, the same color should get displayed. Switching to colorWithDeviceRed would seem to be the way to achieve this on NS, and under X11 the current behavior appears undefined.

-Steve



This bug report was last modified 3 years and 32 days ago.

Previous Next


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