Re: GTK built-in color names (eg: "green", "purple")

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi;

On 30.01.2015 19:53, John W wrote:
> Is there a way to re-define the RGB values of built-in color names in GTK?

no.

> So back to the point: is there any way to change GTK's mapping for color names?
> Or perhaps have GTK use X11 color names?
> 

GTK+ parses CSS-like color strings like 'rgb()' and 'rgba()' by
itself, but named colors and hexadecimal strings are parsed with
pango_color_parse():

https://developer.gnome.org/pango/stable/pango-Text-Attributes.html#pango-color-parse

which uses the CSS spec:

http://dev.w3.org/csswg/css-color/#named-colors

which, in turn, is based on some random version of the X11 rgb.txt file.

inside Pango, the name → color mapping is defined here:

https://git.gnome.org/browse/pango/tree/pango/pango-color-table.h

so if you want GTK+ to use X11 color names (which are fewer and are
completely unspecified and generally should not be used anywhere
because this is not 1987 any more) you will need to modify the table
inside Pango.

-- 
O< ascii ribbon - stop html email! - www.asciiribbon.org

Attachment: 0x922360B0.asc
Description: application/pgp-keys

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux