\documentclass[]{article}
\usepackage{amsmath,graphicx,supertabular,hyperref,tabularx,ifthen}
\title{TIP \#403: Web Colors for Tk}
\date{July 17, 2011}
\author{Jan Nijtmans}
\urlstyle{sf}
\setlength{\parskip}{1ex}
\setlength{\parindent}{0pt}
\def\tipversion$#1${\texttt{\$#1\$}}
\def\tiplangle#1{\ensuremath{<}}
\def\tiprangle#1{\ensuremath{>}}
\def\tipbar#1{\ensuremath{|}}
\def\tipmail#1#2{\(\langle\){\small\expandafter\url{#1@#2}}\(\rangle\)}
\ifx\pdfoutput\undefined
\newcommand{\tipimage}[2]{\typeout{Make sure you download #1.eps}\ifthenelse{\lengthtest{0.8\textwidth>#2}\and\lengthtest{0pt<#2}}{\includegraphics{#1.eps}}{\includegraphics[width=0.8\textwidth]{#1.eps}}}
\newcommand{\tipxref}[1]{}
\newcommand{\tipxrefend}{}
\else
\newcommand{\tipimage}[2]{\typeout{Make sure you create #1.pdf}\ifthenelse{\lengthtest{0.8\textwidth>#2}\and\lengthtest{0pt<#2}}{\includegraphics{#1.pdf}}{\includegraphics[width=0.8\textwidth]{#1.pdf}}}
\pdfcatalog{/PageMode /UseOutlines}
\newcommand{\tipxref}[1]{\pdfannotlink attr {/C [0.5 0.5 1.0] /Border [0 0 1]} goto name {#1}}
\newcommand{\tipxrefend}{\pdfendlink}
\fi
\newenvironment{tipabstract}{\begin{abstract}}{\end{abstract}}
\begin{document}\maketitle
\begin{center}\begin{tabularx}{\linewidth}{|r@{: }X|}\hline
\textbf{TIP \#403}&\textbf{Web Colors for Tk}\\\hline
Author&

Jan Nijtmans \tipmail{jan.nijtmans}{users.sf.net}
\\
Created&Sunday, \(\text{17}^{\text{th}}\) July 2011\\
Type&Project\\
Tcl Version&\(8.6\)\\
State&Final\\
Vote&Done\\
Version&\tipversion$Revision: 1.3 $\\
Keywords&Tk\\
Post History&\\
Discussions To&Tcl Core list\\
\hline\end{tabularx}\end{center}
\thispagestyle{empty}\pagestyle{empty}
\begin{tipabstract}

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.
\end{tipabstract}
\tableofcontents\setcounter{page}{0}\clearpage\pagestyle{plain}

\section{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 \textbf{aqua}, \textbf{fuchsia}, \textbf{lime}, \textbf{olive}, \textbf{silver} and \textbf{teal}, which are currently not known to Tk. Making things worse, some colors like \textbf{green} and \textbf{gray} have a different RGB value in X11 compared to the html4 specification. See: \url{http://www.w3.org/TR/css3-color/\#html4}

\section{Specification}

This document proposes:
\begin{itemize}
\item{}
Add the colors \textbf{aqua}, \textbf{crimson}, \textbf{fuchsia}, \textbf{indigo}, \textbf{lime}, \textbf{olive}, \textbf{silver} and \textbf{teal} to the list of recognised colors, both for win32 and X11. For X11 it will be built in the wrapper function \textit{TkParseColor}, which is a thin wrapper around \textit{XParseColor}. The RGB values used are those from the above mentioned html4 specification (6 from the basic colors, 2 from the extended colors).
\item{}
Modify the RGB values of \textbf{gray/grey}, \textbf{green}, \textbf{maroon} and \textbf{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.

\textbf{POTENTIAL INCOMPATIBILITY}
\end{itemize}

\section{Compatibility}

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

\section{Alternatives}

None

\section{Reference Implementation}

A reference implementation is available at \url{http://core.tcl.tk/tk} in branch \textit{jn-web-colors}. It contains a test-case \textit{color-1.5}, which checkes the RGB values of all known X11 colors with the above modifications. This test is marked \textit{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.

\section{Copyright}

This document has been placed in the public domain.

\section{Colophon}

\textit{TIP AutoGenerator --- written by Donal K. Fellows}
\end{document}
