%% Copyright � 1995-98 by the IBM Corporation. All Rights Reserved.
%%
% ---------------------------------------------------------------------
\section{Using Color in techexplorer}\windowTitle{Using Color}
% ---------------------------------------------------------------------
\def\gtitem{\item[\buttonbox{{\color{black}\tt >}}]}
\def\techexplorerSubsection#1#2{\subsection{{{\color{black}\colorbox{lightgray}{#1}}}}\label{#2}}
\def\TechExpl{techexplorer}
%
\TechExpl{} supports the following
formatting control sequences related to color.
A section heading that has a red frame around it indicates that
the subject discusses a \TechExpl{} extension.

\begin{dirlist}[lv]
\labelLink{saturn:color}{\gtitem\verb+\color+} &
\labelLink{saturn:colorbox}{\gtitem\verb+\colorbox+} &
\labelLink{saturn:fcolorbox}{\gtitem\verb+\fcolorbox+} &
\labelLink{saturn:pagecolor}{\gtitem\verb+\pagecolor+} &
\labelLink{saturn:rgb}{\gtitem\verb+\rgb+} &
\labelLink{saturn:textcolor}{\gtitem\verb+\textcolor+}
\end{dirlist}

\medskip\hrule

% ---------------------------------------------------------------------
\techexplorerSubsection{\verb+\color+}{saturn:color}
% ---------------------------------------------------------------------

Use \verb+\color+ to change the color of text. Normal scoping rules
apply, so include this control sequence in a group if you intend to
localize the color choice.

\begin{description}
\item[Example:]
\begin{verbatim}
Guess which word is in {\color{red}red}.
\end{verbatim}

displays as

\centerline{Guess which word is in {\color{red}red}.}
\end{description}

\bigskip

In some cases, two different names refer to the same color.
Some of the following named colors do not exist in \LaTeX{} $2_\epsilon$.
The standard named colors are:

\def\COLOR#1{\fbox{\colorbox{#1}{\phantom{M}}}\quad\hbox{\small\it #1}\quad}
\centerline{\begin{dirlist}[lv]
\COLOR{black} &
\COLOR{blue} &
\COLOR{cyan} &
\COLOR{darkgray} &
\COLOR{gray} &
\COLOR{green} &
\COLOR{lightgray} &
\COLOR{magenta} &
\COLOR{red} &
\COLOR{white} &
\COLOR{yellow} &
\COLOR{maroon} &
\COLOR{olive} &
\COLOR{navy} &
\COLOR{purple} &
\COLOR{teal} &
\COLOR{silver} &
\COLOR{lime} &
\COLOR{fuchsia} &
\COLOR{aqua}
\end{dirlist}}

The shades of gray are \TechExpl{} extensions.
See \labelLink{saturn:rgb}{\verb+\rgb+} to see how you can mix custom
shades.

Colors can also be used in math mode.
$$
\color{green} \sqrt{2 + \color{blue} \sqrt{x+1}}
$$
Here is a strange array
\[
\left[
\begin{array}{cc}
{\color{red} 2} & {\color{green} 3} \\
{\color{blue} 4} & {\color{red} 5} \\
{\color{green} 6} & {\color{blue} 7}
\end{array}
\right]
\]
\hrule

% ---------------------------------------------------------------------
\techexplorerSubsection{\verb+\rgb+}{saturn:rgb}
% ---------------------------------------------------------------------

Use \verb+\rgb+ to custom mix your own colors using the RGB color scheme.
This control sequence takes three arguments, each of which must be a number
between 0 and 255, inclusive. The first is the red value, the second is
the green value, and the third is the blue value.
Of course, the number of colors supported by your hardware will greatly
affect the colors you see.

When all three values are the same you get a shade of gray.
The color black
is \verb+\rgb{0}{0}{0}+ and the color white is \verb+\rgb{255}{255}{255}+.

Here are some examples

\def\RGBCOLOR#1#2#3{\fbox{\colorbox{\rgb{#1}{#2}{#3}}{\phantom{M}}}\quad
\hbox{\tt\verb+\rgb{+#1\verb+}{+#2\verb+}{+#3\verb+}+}\quad}

\centerline{\begin{dirlist}[lv]
\RGBCOLOR{128}{0}{0} &
\RGBCOLOR{0}{128}{0} &
\RGBCOLOR{0}{0}{128} &
\RGBCOLOR{64}{128}{193} &
\RGBCOLOR{164}{128}{64} &
\RGBCOLOR{64}{255}{255}
\end{dirlist}}

\hrule

% ---------------------------------------------------------------------
\techexplorerSubsection{\verb+\textcolor+}{saturn:textcolor}
% ---------------------------------------------------------------------

Use \verb+\textcolor+ to change the color of text. It has two arguments:
the first is the color (as in \labelLink{saturn:color}{\verb+\color+})
and the second is the text whose color you want to set.

The expression \verb+\textcolor{COLOR}{TEXT}+ is equivalent to
\verb+{\color{COLOR}TEXT}

\begin{description}
\item[Example:]
\begin{verbatim}
\textcolor{red}{This is red!}
\end{verbatim}
displays as
\centerline{\textcolor{red}{This is red!}}
\end{description}

\hrule

% ---------------------------------------------------------------------
\techexplorerSubsection{\verb+\colorbox+}{saturn:colorbox}
% ---------------------------------------------------------------------

Use \verb+\colorbox+ to place text in a box with a given background color.
It has two arguments:
the first is the color (as in \labelLink{saturn:color}{\verb+\color+})
and the second is the text.

\begin{description}
\item[Example:]
\begin{verbatim}
\colorbox{lightgray}{Can you guess how we made the headings?}
\end{verbatim}

displays as

\centerline{\colorbox{lightgray}{Can you guess how we made the headings?}}
\end{description}

You can also nest \verb+\colorbox+ expressions:

\begin{description}
\item[Example:]
\begin{verbatim}
\colorbox{black}{\colorbox{blue}{{\color{yellow}techexplorer}}}
\end{verbatim}

displays as

\centerline{\colorbox{black}{\colorbox{blue}{{\color{yellow}techexplorer}}}}
\end{description}

\medskip\hrule

% ---------------------------------------------------------------------
\techexplorerSubsection{\verb+\fcolorbox+}{saturn:fcolorbox}
% ---------------------------------------------------------------------

Use \verb+\fcolorbox+ to place text in a box with a given background color and
a frame with a given color.
It has three arguments:
\begin{enumerate}
\item the color of the line around the box,
\item the color (as in \labelLink{saturn:color}{\verb+\color+}), and
\item the text.
\end{enumerate}

\begin{description}
\item[Example:]
\begin{verbatim}
\fcolorbox{black}{blue}{\color{yellow}techexplorer}
\end{verbatim}

displays as

\centerline{\fcolorbox{black}{blue}{\color{yellow}techexplorer}}
\end{description}

\medskip\hrule

% ---------------------------------------------------------------------
\techexplorerSubsection{\verb+\pagecolor+}{saturn:pagecolor}
% ---------------------------------------------------------------------

Use \verb+\pagecolor+ to change the background color for a whole document.
It has a single argument which must be a color specification
(as in \labelLink{saturn:color}{\verb+\color+}; also see
\labelLink{saturn:rgb}{\verb+\rgb+}).
It is local to the document in which it appears.
