unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Łukasz Stelmach" <stlman@poczta.fm>
To: 15837@debbugs.gnu.org
Subject: bug#15837: 24.3; invalid colour conversion from Gtk+3 to X11
Date: Fri, 08 Nov 2013 19:16:18 +0100	[thread overview]
Message-ID: <87mwle21zh.fsf%stlman@poczta.fm> (raw)

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...





             reply	other threads:[~2013-11-08 18:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-08 18:16 Łukasz Stelmach [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mwle21zh.fsf%stlman@poczta.fm \
    --to=stlman@poczta.fm \
    --cc=15837@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).