Current File : //usr/share/texlive/texmf-dist/tex/latex/graphics/color.sty |
%%
%% This is file `color.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% color.dtx (with options: `package')
%%
%% The source is maintained by the LaTeX Project team and bug
%% reports for it can be opened at https://latex-project.org/bugs/
%% (but please observe conditions on bug reports sent to that address!)
%%
%%
%% color.dtx Copyright (C) 1994--1999 David Carlisle
%% Copyright (C) 2005-2020 David Carlisle, LaTeX3 Project
%%
%% This file is part of the Standard LaTeX `Graphics Bundle'.
%% It may be distributed under the terms of the LaTeX Project Public
%% License, as described in lppl.txt in the base LaTeX distribution.
%% Either version 1.3c or, at your option, any later version.
%%
%% This file has the LPPL maintenance status "maintained".
%%
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{color}
[2020/02/24 v1.2b Standard LaTeX Color (DPC)]
\edef\Gin@codes{%
\catcode`\noexpand\^^A\the\catcode`\^^A\relax
\catcode`\noexpand\"\the\catcode`\"\relax
\catcode`\noexpand\*\the\catcode`\*\relax
\catcode`\noexpand\!\the\catcode`\!\relax
\catcode`\noexpand\:\the\catcode`\:\relax}
\catcode`\^^A=\catcode`\%
\catcode`\"=12
\catcode`\*=11
\catcode`\!=12
\catcode`\:=12
\providecommand\Gin@driver{}
\def\c@lor@error#1{%
\@latex@error{Undefined color #1}\@ehd}
\DeclareOption{monochrome}{%
\def\c@lor@error#1{\PackageInfo{color}{Undefined color #1}}%
\AtEndOfPackage{%
\colors@false
\def\set@color{%
\c@lor@special\m@ne
{color push \current@color}\aftergroup\reset@color}%
\def\reset@color{\c@lor@special\m@ne{color pop}}%
\def\set@page@color{%
\c@lor@special\m@ne{background \current@color}}%
\def\define@color#1#2{%
\c@lor@special\m@ne{define #1 #2}}}}
\DeclareOption{debugshow}{\catcode`\^^A=9 \let\GDebug\typeout}
\newif\ifGin@setpagesize\Gin@setpagesizetrue
\DeclareOption{setpagesize}{\Gin@setpagesizetrue}
\DeclareOption{nosetpagesize}{\Gin@setpagesizefalse}
\DeclareOption{dvips}{\def\Gin@driver{dvips.def}%
\def\c@lor@namefile{dvipsnam.def}}
\DeclareOption{xdvi}{\ExecuteOptions{dvips,monochrome}}
\DeclareOption{dvipdf}{\def\Gin@driver{dvipdf.def}}
\DeclareOption{dvipdfm}{\def\Gin@driver{dvipdfm.def}}
\DeclareOption{dvipdfmx}{\def\Gin@driver{dvipdfmx.def}}
\DeclareOption{pdftex}{\def\Gin@driver{pdftex.def}}
\DeclareOption{luatex}{\def\Gin@driver{luatex.def}}
\DeclareOption{dvisvgm}{\def\Gin@driver{dvisvgm.def}}
\DeclareOption{xetex}{\def\Gin@driver{xetex.def}}
\DeclareOption{dvipsone}{\def\Gin@driver{dvipsone.def}}
\DeclareOption{dviwindo}{\ExecuteOptions{dvipsone}}
\DeclareOption{emtex}{\def\Gin@driver{emtex.def}}
\DeclareOption{dviwin}{\def\Gin@driver{dviwin.def}}
\DeclareOption{oztex}{\ExecuteOptions{dvips}}
\DeclareOption{textures}{\def\Gin@driver{textures.def}}
\DeclareOption{pctexps}{\def\Gin@driver{pctexps.def}}
\DeclareOption{pctexwin}{\def\Gin@driver{pctexwin.def}}
\DeclareOption{pctexhp}{\def\Gin@driver{pctexhp.def}}
\DeclareOption{pctex32}{\def\Gin@driver{pctex32.def}}
\DeclareOption{truetex}{\def\Gin@driver{truetex.def}}
\DeclareOption{tcidvi}{\def\Gin@driver{tcidvi.def}}
\DeclareOption{vtex}{\def\Gin@driver{vtex.def}}
\DeclareOption{dvipsnames}{\def\c@lor@namefile{dvipsnam.def}}
\DeclareOption{nodvipsnames}{\let\c@lor@namefile\relax}
\let\c@lor@usename\@gobble
\DeclareOption{usenames}{%
\def\c@lor@usename#1{%
\expandafter\color@named\csname\string\color @#1\endcsname{#1}}}
\DeclareRobustCommand\color{%
\@ifnextchar[\@undeclaredcolor\@declaredcolor}
\def\@undeclaredcolor[#1]#2{%
\@ifundefined{color@#1}%
{\c@lor@error{model `#1'}}%
{\csname color@#1\endcsname\current@color{#2}%
\set@color}%
\ignorespaces}
\def\@declaredcolor#1{%
\@ifundefined{\string\color @#1}%
{\c@lor@error{`#1'}}%
{\expandafter\let\expandafter\current@color
\csname\string\color @#1\endcsname
\set@color}%
\ignorespaces}
\protected\def\textcolor#1#{\@textcolor{#1}}
\def\@textcolor#1#2#3{\protect\leavevmode{\color#1{#2}#3}}
\protected\def\pagecolor{%
\begingroup
\let\ignorespaces\endgroup
\let\set@color\set@page@color
\color}
\protected\def\nopagecolor{%
\@ifundefined{no@page@color}{%
\PackageInfo{color}{\string\nopagecolor\space is not supported}%
}{%
\no@page@color
}%
}
\protected\def\definecolor#1#2#3{%
\@ifundefined{color@#2}%
{\c@lor@error{model `#2'}}%
{\@ifundefined{\string\color @#1}{}%
{\PackageInfo{color}{Redefining color #1}}%
\csname color@#2\expandafter\endcsname
\csname\string\color @#1\endcsname{#3}}}
\protected\def\DefineNamedColor#1#2#3#4{%
\@ifundefined{define@color@#1}%
{\c@lor@error{model `#1'}}%
{\@ifundefined{color@#3}%
{\c@lor@error{model `#3'}}%
{\@ifundefined{col@#2}{}%
{\PackageInfo{color}{Redefining color #2 in named color model}}%
\csname color@#3\endcsname\@tempa{#4}%
\csname define@color@#1\endcsname{#2}\@tempa
\c@lor@usename{#2}}}}
\@onlypreamble\DefineNamedColor
\newif\ifcolors@
\colors@true
\def\c@lor@special#1#2{%
\edef\@tempa{\write#1{#2}}\@tempa}
\InputIfFileExists{color.cfg}{}{}
\ProcessOptions
\if!\Gin@driver!
\PackageError{color}
{No driver specified}
{You should make a default driver option in a file \MessageBreak
color.cfg\MessageBreak
eg: \protect\ExecuteOptions{dvips}%
}
\else
\PackageInfo{color}{Driver file: \Gin@driver}
\@ifundefined{ver@\Gin@driver}{\input{\Gin@driver}}{}
\fi
\@ifundefined{c@lor@namefile}{}{\input{\c@lor@namefile}}
\protected\def\normalcolor{\let\current@color\default@color\set@color}
\AtBeginDocument{\let\default@color\current@color}
\def\color@block#1#2#3{%
{\set@color\rlap{\ifcolors@\vrule\@width#1\@height#2\@depth#3\fi}}}
\protected\def\colorbox#1#{\color@box{#1}}
\def\color@box#1#2{\color@b@x\relax{\color#1{#2}}}
\protected\def\fcolorbox#1#{\color@fbox{#1}}
\def\color@fbox#1#2#3{%
\color@b@x{\fboxsep\z@\color#1{#2}\fbox}{\color#1{#3}}}
\long\def\color@b@x#1#2#3{%
\leavevmode
\setbox\z@\hbox{\kern\fboxsep{\set@color#3}\kern\fboxsep}%
\dimen@\ht\z@\advance\dimen@\fboxsep\ht\z@\dimen@
\dimen@\dp\z@\advance\dimen@\fboxsep\dp\z@\dimen@
{#1{#2\color@block{\wd\z@}{\ht\z@}{\dp\z@}%
\box\z@}}}
\def\color@setgroup{\begingroup\set@color}
\let\color@begingroup\begingroup
\def\color@endgroup{\endgraf\endgroup}
\def\color@hbox{\hbox\bgroup\color@begingroup}
\def\color@vbox{\vbox\bgroup\color@begingroup}
\def\color@endbox{\color@endgroup\egroup}
\ifx\color@gray\@undefined
\ifx\color@rgb\@undefined
\else
\definecolor{black}{rgb}{0,0,0}
\definecolor{white}{rgb}{1,1,1}
\fi
\else
\definecolor{black}{gray}{0}
\definecolor{white}{gray}{1}
\fi
\ifx\color@rgb\@undefined\else
\definecolor{red}{rgb}{1,0,0}
\definecolor{green}{rgb}{0,1,0}
\definecolor{blue}{rgb}{0,0,1}
\fi
\ifx\color@cmyk\@undefined\else
\definecolor{cyan}{cmyk}{1,0,0,0}
\definecolor{magenta}{cmyk}{0,1,0,0}
\definecolor{yellow}{cmyk}{0,0,1,0}
\fi
\Gin@codes
\let\Gin@codes\relax
\endinput
%%
%% End of file `color.sty'.