% This is COLORDVI.TEX and COLORDVI.STY in text format, as of
% March 5, 1992, written by Jim Hafner, HAFNER@ALMADEN, or
% hafner@almaden.ibm.com.  Modified by Tomas Rokicki to be a
% bit smaller and easier to add to.  Same license as dvips.
%
% 20 Aug. 1992: Revised by J. Hafner, by adding \globalColor.
%
% This style file can be used to get color in TeX, LaTeX or more
% importantly, FoilTeX as an optional style file.  It is generic in
% that the color parameters are determined by the driver's header files.
%
% It can be used with any driver which knows how to process the keywords
% in the \special commands.  Currently, only versions of dvips greater
% than 5.478 (dvips is the DVI->PostScript driver by Tom Rokicki) and
% TeXview on the NeXT interpret these specials.
%
% This file can be used in any flavor of LaTeX (e.g. LaTeX, FoilTeX,
% AMS-LaTeX) by adding the keyword "colordvi" to the options in the
% \documentstyle command (e.g., "\documentstyle[colordvi]{foils}") or \input
% in any flavor of TeX (e.g. Plain TeX, eplain, AMS-TeX or any of the
% above LaTeX flavors) with the command "\input colordvi".
%
% The actual parameters for each color are determined by the device
% driver.
% For "dvips", that is the header file color.pro prepended to the
% output file by dvips.  They can be overrriden by a user-supplied
% header, called by either the -h option or the "h" flag in a printer
% configuration file, or in the .dvipsrc (or its analogue on other
% systems).
%
% Most of the color names and their matches were based on the
% most recent (at time of writing) Crayola Crayon box of 64 colors.
%
% There are 68 predefined colors.  At the end of this file is a
% listing of the color names and their approximate PANTONE color
% match.  This is for reference purposes only.
%
% The first macro lets the user specify the background color for the
% document.  It sets the background color for the current page and all
% succeeding pages, unless changed by another command of this type.  To
% change the background color back to the default, issue
% \background{White}
%
\def\background#1{\special{background #1}}
%
% There are two types of text color commands.  The first is in the form
%    \ColorName   (note the uppercase for the color name).
%
% It is called a local color command since it takes one argument
% enclosed in brackets.  It writes the contents of its argument in the
% selected color.  This should be used for local or nested color
% changes, since it restores the original color state when it completes.
% The second type of color command is in the form
%    \textColorName
% This uses the same naming convention as before.  It is called a global
% color command since it takes no arguments and simply sets the color at
% this point.  No previous color information is saved.  IF YOU USE THIS
% INTERNAL TO ANY LOCAL COLOR COMMAND, THE NESTING HISTORY IS LOST.
%
% This next definition is used in an invocation of a \textColorName
% macro to save the global color value in local form via the \globalColor
% macro.  This new macro can then be used to protect certain regions of
% the text, like item tags and headers and footers which can be
% corrupted by local colors.  In particular, item tags in lists can
% incorrectly inherit the color from a local color command immediately
% following it.  The \subdef macro is invoked within the invocation of a
% global color change.
%
\def\subdef#1{\gdef\globalColor##1{\special
       {color push #1}##1\special{color pop}}}
%
% Here are the global color changers, with color codes defined;
% these are used to define the small region colors.
%
% This first is for user defined color.  The argument #1 is for a "CMYK"
% quadruple of intensity values between 0 and 1.  (CMYK stands for Cyan,
% Magenta, Yellow and Black.)  E.g., \textColor{.2 .3 .4 .1}
%
\def\textColor#1{\subdef{cmyk #1}\special{color cmyk #1}}
%
% and a userdefinable local color command.
\def\Color#1#2{\special{color push cmyk #1}#2\special{color pop}}
%
%
\def\newColor #1 {\expandafter\def\csname #1\endcsname##1{\special
   {color push #1}##1\special{color pop}}%
   \expandafter\def\csname text#1\endcsname{\subdef{#1}%
    \special{color #1}}}%
%
% Here are the color names and their PANTONE match (approximately)
%
\newColor GreenYellow     % GreenYellow  Approximate PANTONE 388
\newColor Yellow	  % Yellow  Approximate PANTONE YELLOW
\newColor Goldenrod	  % Goldenrod  Approximate PANTONE 109
\newColor Dandelion	  % Dandelion  Approximate PANTONE 123
\newColor Apricot	  % Apricot  Approximate PANTONE 1565
\newColor Peach		  % Peach  Approximate PANTONE 164
\newColor Melon		  % Melon  Approximate PANTONE 177
\newColor YellowOrange	  % YellowOrange  Approximate PANTONE 130
\newColor Orange	  % Orange  Approximate PANTONE ORANGE-021
\newColor BurntOrange	  % BurntOrange  Approximate PANTONE 388
\newColor Bittersweet	  % Bittersweet  Approximate PANTONE 167
\newColor RedOrange	  % RedOrange  Approximate PANTONE 179
\newColor Mahogany	  % Mahogany  Approximate PANTONE 484
\newColor Maroon	  % Maroon  Approximate PANTONE 201
\newColor BrickRed	  % BrickRed  Approximate PANTONE 1805
\newColor Red		  % Red  VERY-Approx PANTONE RED
\newColor OrangeRed	  % OrangeRed  No PANTONE match
\newColor RubineRed	  % RubineRed  Approximate PANTONE RUBINE-RED
\newColor WildStrawberry  % WildStrawberry  Approximate PANTONE 206
\newColor Salmon	  % Salmon  Approximate PANTONE 183
\newColor CarnationPink	  % CarnationPink  Approximate PANTONE 218
\newColor Magenta	  % Magenta  Approximate PANTONE PROCESS-MAGENTA
\newColor VioletRed	  % VioletRed  Approximate PANTONE 219
\newColor Rhodamine	  % Rhodamine  Approximate PANTONE RHODAMINE-RED
\newColor Mulberry	  % Mulberry  Approximate PANTONE 241
\newColor RedViolet	  % RedViolet  Approximate PANTONE 234
\newColor Fuchsia	  % Fuchsia  Approximate PANTONE 248
\newColor Lavender	  % Lavender  Approximate PANTONE 223
\newColor Thistle	  % Thistle  Approximate PANTONE 245
\newColor Orchid	  % Orchid  Approximate PANTONE 252
\newColor DarkOrchid	  % DarkOrchid  No PANTONE match
\newColor Purple	  % Purple  Approximate PANTONE PURPLE
\newColor Plum		  % Plum  VERY-Approx PANTONE 518
\newColor Violet	  % Violet  Approximate PANTONE VIOLET
\newColor RoyalPurple	  % RoyalPurple  Approximate PANTONE 267
\newColor BlueViolet	  % BlueViolet  Approximate PANTONE 2755
\newColor Periwinkle	  % Periwinkle  Approximate PANTONE 2715
\newColor CadetBlue	  % CadetBlue  Approximate PANTONE (534+535)/2
\newColor CornflowerBlue  % CornflowerBlue  Approximate PANTONE 292
\newColor MidnightBlue	  % MidnightBlue  Approximate PANTONE 302
\newColor NavyBlue	  % NavyBlue  Approximate PANTONE 293
\newColor RoyalBlue	  % RoyalBlue  No PANTONE match
\newColor Blue		  % Blue  Approximate PANTONE BLUE-072
\newColor Cerulean	  % Cerulean  Approximate PANTONE 3005
\newColor Cyan		  % Cyan  Approximate PANTONE PROCESS-CYAN
\newColor ProcessBlue	  % ProcessBlue  Approximate PANTONE PROCESS-BLUE
\newColor SkyBlue	  % SkyBlue  Approximate PANTONE 2985
\newColor Turquoise	  % Turquoise  Approximate PANTONE (312+313)/2
\newColor TealBlue	  % TealBlue  Approximate PANTONE 3145
\newColor Aquamarine	  % Aquamarine  Approximate PANTONE 3135
\newColor BlueGreen	  % BlueGreen  Approximate PANTONE 320
\newColor Emerald	  % Emerald  No PANTONE match
\newColor JungleGreen	  % JungleGreen  Approximate PANTONE 328
\newColor SeaGreen	  % SeaGreen  Approximate PANTONE 3268
\newColor Green		  % Green  VERY-Approx PANTONE GREEN
\newColor ForestGreen	  % ForestGreen  Approximate PANTONE 349
\newColor PineGreen	  % PineGreen  Approximate PANTONE 323
\newColor LimeGreen	  % LimeGreen  No PANTONE match
\newColor YellowGreen	  % YellowGreen  Approximate PANTONE 375
\newColor SpringGreen	  % SpringGreen  Approximate PANTONE 381
\newColor OliveGreen	  % OliveGreen  Approximate PANTONE 582
\newColor RawSienna	  % RawSienna  Approximate PANTONE 154
\newColor Sepia		  % Sepia  Approximate PANTONE 161
\newColor Brown		  % Brown  Approximate PANTONE 1615
\newColor Tan		  % Tan  No PANTONE match
\newColor Gray		  % Gray  Approximate PANTONE COOL-GRAY-8
\newColor Black		  % Black  Approximate PANTONE PROCESS-BLACK
\newColor White		  % White  No PANTONE match

% Now we make sure that we initialize the global color to Black
\subdef{Black}
