TIP 403: Web Colors for Tk

Login
Author:         Jan Nijtmans <[email protected]>
State:          Final
Type:           Project
Vote:           Done
Created:        17-Jul-2011
Post-History:   
Discussions-To: Tcl Core list
Keywords:       Tk
Tcl-Version:    8.6
Tk-Branch:      jn-web-colors

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 https://core.tcl-lang.org/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.