unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#15837: 24.3; invalid colour conversion from Gtk+3 to X11
@ 2013-11-08 18:16 Łukasz Stelmach
  2013-11-08 18:41 ` bug#15837: [PATCH] Pass colours using rgb: instead of rgbi: Łukasz Stelmach
  0 siblings, 1 reply; 3+ messages in thread
From: Łukasz Stelmach @ 2013-11-08 18:16 UTC (permalink / raw)
  To: 15837

Hello,

The function[1] that reads foreground and background colours from Gtk+3
(GdkRGBA) and converts them to X11 ones (XColor) uses improper
intermediate representation. The Gtk coulour is formated as
rgbi:<red>/<green>/<blue>. Although values prefixed with rgbi: are meant
to be floating point values like the ones returned by
gtk_style_context_get_*() functions but unlike Gtk colours they are
meant to be linear intensity values and will be gamma corrected[2] using
the tables[3] in Xlib.

You can check the effect for yourself by running:

xterm -bg '#777'
xterm -bg 'rgb:7777/7777/7777'
xterm -bg 'rgb:0.46667/0.46667/0.46667'

The last one will be significantly lighter.

0.46667/0.46667/0.46667 is the value returned by Gtk when a colour is
set to #777.

A patch will follow this report.

References:

[1] http://git.savannah.gnu.org/cgit/emacs.git/tree/src/gtkutil.c?id=c09a36ec78af479cb2ea39bf4bca8743cecd08df#n601

[2] http://cgit.freedesktop.org/xorg/doc/xorg-docs/tree/man/X.man?id=66e800c69fa5348b01e4b9670d6274ba392db7e5#n562

[3] http://cgit.freedesktop.org/xorg/lib/libX11/tree/src/xcms/LRGB.c?id=6cb02b166361200da35ba14f52cd9aaa493eb0ea#n224
-- 
Było mi bardzo miło.                                  --- Rurku. --- ...
>Łukasz<                                --- To dobrze, że mnie słuchasz.

... Droga wśród jabłoni prowadzi w nieznane...





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-11-09 11:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-08 18:16 bug#15837: 24.3; invalid colour conversion from Gtk+3 to X11 Łukasz Stelmach
2013-11-08 18:41 ` bug#15837: [PATCH] Pass colours using rgb: instead of rgbi: Łukasz Stelmach
2013-11-09 11:20   ` Jan Djärv

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).