TIP #403: WEB COLORS FOR TK ============================= Version: $Revision: 1.3 $ Author: Jan Nijtmans State: Final Type: Project Tcl-Version: 8.6 Vote: Done Created: Sunday, 17 July 2011 URL: https://tip.tcl-lang.org403.html Discussions-To: Tcl Core list Post-History: ------------------------------------------------------------------------- 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: SPECIFICATION =============== This document proposes: * Add the colors *aqua*, *crimson*, *fuchsia*, *indigo*, *lime*, *olive*, *silver* and *teal* to the list of recognised colors, both for win32 and X11. For X11 it will be built in the wrapper function /TkParseColor/, which is a thin wrapper around /XParseColor/. The RGB values used are those from the above mentioned html4 specification (6 from the basic colors, 2 from the extended colors). * Modify the RGB values of *gray/grey*, *green*, *maroon* and *purple* matching the html4 specification. Those 4 colors are the only ones that differ in X11. Applications using those colors will change in visible appearance. *POTENTIAL INCOMPATIBILITY* 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: ALTERNATIVES ============== None REFERENCE IMPLEMENTATION ========================== A reference implementation is available at 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. ------------------------------------------------------------------------- TIP AutoGenerator - written by Donal K. Fellows