TIP #403: Web Colors for Tk


TIP:403
Title:Web Colors for Tk
Version:$Revision: 1.3 $
Author:Jan Nijtmans <jan dot nijtmans at users dot sf dot net>
State:Final
Type:Project
Tcl-Version:8.6
Vote:Done
Created:Sunday, 17 July 2011
Discussions To:Tcl Core list
Keywords:Tk

Abstract

This TIP proposes some modifications in the RGB values of various colors as used in Tk, bringing those colors more in line with various W3C standards.

Rationale

There is a difference between the color definitions in X11 and the color definitions in Web standards like html and css. For example HTML4 defines the basic color names aqua, fuchsia, lime, olive, silver and teal, which are currently not known to Tk. Making things worse, some colors like green and gray have a different RGB value in X11 compared to the html4 specification. See: http://www.w3.org/TR/css3-color/#html4

Specification

This document proposes:

Compatibility

On the script level nothing changes, only applications one or more colors from the list gray, grey, green, maroon and purple will change in visible appearance. A side-by-side visible difference between those 4 colors can be seen at: http://en.wikipedia.org/wiki/X11_color_names#Color_name_clashes

Alternatives

None

Reference Implementation

A reference implementation is available at http://core.tcl.tk/tk in branch jn-web-colors. It contains a test-case color-1.5, which checkes the RGB values of all known X11 colors with the above modifications. This test is marked nonPortable, simply because I don't know how many older X11 color lists are still in use. On win32, mac and any reasonable recent X11 package, this test passes.

Copyright

This document has been placed in the public domain.


Powered by Tcl[Index] [History] [HTML Format] [Source Format] [LaTeX Format] [Text Format] [XML Format] [*roff Format (experimental)] [RTF Format (experimental)]

TIP AutoGenerator - written by Donal K. Fellows