Debian Codegraph @

texmf-dist/tex/latex/pdfmanagement/color-ltx.sty

raw
1 %%
2 %% This is file `color.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% color.dtx (with options: `package')
8 %%
9 %% The source is maintained by the LaTeX Project team and bug
10 %% reports for it can be opened at https://latex-project.org/bugs/
11 %% (but please observe conditions on bug reports sent to that address!)
12 %%
13 %%
14 %% color.dtx Copyright (C) 1994--1999 David Carlisle
15 %% Copyright (C) 2005-2022
16 %% The LaTeX Project and any individual authors listed elsewhere
17 %% in this file.
18 %%
19 %% This file is part of the Standard LaTeX `Graphics Bundle'.
20 %% It may be distributed under the terms of the LaTeX Project Public
21 %% License, as described in lppl.txt in the base LaTeX distribution.
22 %% Either version 1.3c or, at your option, any later version.
23 %%
24 %% This file has the LPPL maintenance status "maintained".
25 %%
26 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
27 \ProvidesPackage{color-ltx}[2026-05-26 v0.97c
28 Standard LaTeX Color (patched for l3color, part of pdfmanagement-testphase, original version 2022/01/06 v1.3d) (DPC)]
29 \edef\Gin@codes{%
30 \catcode`\noexpand\^^A\the\catcode`\^^A\relax
31 \catcode`\noexpand\"\the\catcode`\"\relax
32 \catcode`\noexpand\*\the\catcode`\*\relax
33 \catcode`\noexpand\!\the\catcode`\!\relax
34 \catcode`\noexpand\:\the\catcode`\:\relax}
35 \catcode`\^^A=\catcode`\%
36 \catcode`\"=12
37 \catcode`\*=11
38 \catcode`\!=12
39 \catcode`\:=12
40 \providecommand\Gin@driver{}
41 \def\c@lor@error#1{%
42 \@latex@error{Undefined color #1}\@ehd}
43 \DeclareOption{monochrome}{%
44 \def\c@lor@error#1{\PackageInfo{color}{Undefined color #1}}%
45 \AtEndOfPackage{%
46 \colors@false
47 \def\set@color{%
48 \c@lor@special\m@ne
49 {color push \current@color}\aftergroup\reset@color}%
50 \def\reset@color{\c@lor@special\m@ne{color pop}}%
51 \def\set@page@color{%
52 \c@lor@special\m@ne{background \current@color}}%
53 \def\define@color#1#2{%
54 \c@lor@special\m@ne{define #1 #2}}}}
55 \DeclareOption{debugshow}{\catcode`\^^A=9 \let\GDebug\typeout}
56 \newif\ifGin@setpagesize\Gin@setpagesizetrue
57 \DeclareOption{setpagesize}{\Gin@setpagesizetrue}
58 \DeclareOption{nosetpagesize}{\Gin@setpagesizefalse}
59 \DeclareOption{dvips}{\def\Gin@driver{dvips.def}%
60 \def\c@lor@namefile{dvipsnam.def}}
61 \DeclareOption{xdvi}{\ExecuteOptions{dvips,monochrome}}
62 \DeclareOption{dvipdf}{\def\Gin@driver{dvipdf.def}}
63 \DeclareOption{dvipdfm}{\def\Gin@driver{dvipdfmx.def}}
64 \DeclareOption{dvipdfmx}{\def\Gin@driver{dvipdfmx.def}}
65 \DeclareOption{pdftex}{\def\Gin@driver{pdftex.def}}
66 \DeclareOption{luatex}{\def\Gin@driver{luatex.def}}
67 \DeclareOption{dvisvgm}{\def\Gin@driver{dvisvgm.def}}
68 \DeclareOption{xetex}{\def\Gin@driver{xetex.def}}
69 \DeclareOption{dvipsone}{\def\Gin@driver{dvipsone.def}}
70 \DeclareOption{dviwindo}{\ExecuteOptions{dvipsone}}
71 \DeclareOption{emtex}{\def\Gin@driver{emtex.def}}
72 \DeclareOption{dviwin}{\def\Gin@driver{dviwin.def}}
73 \DeclareOption{oztex}{\ExecuteOptions{dvips}}
74 \DeclareOption{textures}{\def\Gin@driver{textures.def}}
75 \DeclareOption{pctexps}{\def\Gin@driver{pctexps.def}}
76 \DeclareOption{pctexwin}{\def\Gin@driver{pctexwin.def}}
77 \DeclareOption{pctexhp}{\def\Gin@driver{pctexhp.def}}
78 \DeclareOption{pctex32}{\def\Gin@driver{pctex32.def}}
79 \DeclareOption{truetex}{\def\Gin@driver{truetex.def}}
80 \DeclareOption{tcidvi}{\def\Gin@driver{tcidvi.def}}
81 \DeclareOption{vtex}{\def\Gin@driver{vtex.def}}
82 \DeclareOption{dvipsnames}{\def\c@lor@namefile{dvipsnam.def}}
83 \DeclareOption{nodvipsnames}{\let\c@lor@namefile\relax}
84 \let\c@lor@usename\@gobble
85 \DeclareOption{usenames}{%
86 \def\c@lor@usename#1{%
87 \expandafter\color@named\csname\@backslashchar color@#1\endcsname{#1}}}
88 \DeclareRobustCommand\color{%
89 \@ifnextchar[\@undeclaredcolor\@declaredcolor}
90 \def\@undeclaredcolor[#1]#2{%
91 \@ifundefined{color@#1}%
92 {\c@lor@error{model `#1'}}%
93 {\csname color@#1\endcsname\current@color{#2}%
94 \set@color}%
95 \ignorespaces}
96 \def\@declaredcolor#1{%
97 \@ifundefined{\@backslashchar color@#1}%
98 {\c@lor@error{`#1'}}%
99 {\expandafter\let\expandafter\current@color
100 \csname\@backslashchar color@#1\endcsname
101 \set@color}%
102 \ignorespaces}
103 \protected\def\textcolor#1#{\@textcolor{#1}}
104 \def\@textcolor#1#2#3{\protect\leavevmode{\color#1{#2}#3}}
105 \protected\def\pagecolor{%
106 \begingroup
107 \let\ignorespaces\endgroup
108 \let\set@color\set@page@color
109 \color}
110 \protected\def\nopagecolor{%
111 \@ifundefined{no@page@color}{%
112 \PackageInfo{color}{\@backslashchar nopagecolor\space is not supported}%
113 }{%
114 \no@page@color
115 }%
116 }
117 \protected\def\definecolor#1#2#3{%
118 \@ifundefined{color@#2}%
119 {\c@lor@error{model `#2'}}%
120 {\@ifundefined{\@backslashchar color@#1}{}%
121 {\PackageInfo{color}{Redefining color #1}}%
122 \csname color@#2\expandafter\endcsname
123 \csname\@backslashchar color@#1\endcsname{#3}}%
124 \@expl@color@set@@nnn{#1}{#2}{#3}%
125 }
126 \protected\def\DefineNamedColor#1#2#3#4{%
127 \@ifundefined{define@color@#1}%
128 {\c@lor@error{model `#1'}}%
129 {\@ifundefined{color@#3}%
130 {\c@lor@error{model `#3'}}%
131 {\@ifundefined{col@#2}{}%
132 {\PackageInfo{color}{Redefining color #2 in named color model}}%
133 \csname color@#3\endcsname\@tempa{#4}%
134 \@expl@color@set@@nnn{#2}{#3}{#4}%
135 \csname define@color@#1\endcsname{#2}\@tempa
136 \c@lor@usename{#2}}}}
137 \@onlypreamble\DefineNamedColor
138 \protected\def\@expl@color@set@@nnn#1#2#3{}
139 \ExplSyntaxOn
140 \cs_set_protected:Npn \@expl@color@set@@nnn #1 #2 #3
141 {
142 \str_if_eq:nnTF {#2}{named}
143 {
144 \color_set:nn {#1}{#3}
145 }
146 {
147 \color_set:nnn {#1}{#2}{#3}
148 }
149 }
150 \ExplSyntaxOff
151 \newif\ifcolors@
152 \colors@true
153 \def\c@lor@special#1#2{%
154 \edef\@tempa{\write#1{#2}}\@tempa}
155 \InputIfFileExists{color.cfg}{}{}
156 \ProcessOptions
157 \if!\Gin@driver!
158 \PackageError{color}
159 {No driver specified}
160 {You should make a default driver option in a file \MessageBreak
161 color.cfg\MessageBreak
162 eg: \protect\ExecuteOptions{dvips}%
163 }
164 \else
165 \PackageInfo{color}{Driver file: \Gin@driver}
166 \@ifundefined{ver@\Gin@driver}{\input{\Gin@driver}}{}
167 \fi
168 \@ifundefined{c@lor@namefile}{}{\input{\c@lor@namefile}}
169 \protected\def\normalcolor{\let\current@color\default@color\set@color}
170 \AtBeginDocument{\let\default@color\current@color}
171 \def\color@block#1#2#3{%
172 {\set@color\rlap{\ifcolors@\vrule\@width#1\@height#2\@depth#3\fi}}}
173 \protected\def\colorbox#1#{\color@box{#1}}
174 \def\color@box#1#2{\color@b@x\relax{\color#1{#2}}}
175 \protected\def\fcolorbox#1#{\color@fbox{#1}}
176 \def\color@fbox#1#2#3{%
177 \color@b@x{\fboxsep\z@\color#1{#2}\fbox}{\color#1{#3}}}
178
179 \long\def\color@b@x#1#2#3{%
180 \leavevmode
181 \setbox\z@\hbox{\kern\fboxsep{\set@color#3}\kern\fboxsep}%
182 \dimen@\ht\z@\advance\dimen@\fboxsep\ht\z@\dimen@
183 \dimen@\dp\z@\advance\dimen@\fboxsep\dp\z@\dimen@
184 {#1{#2\color@block{\wd\z@}{\ht\z@}{\dp\z@}%
185 \box\z@}}}
186 \InputIfFileExists{mathcolor.ltx}{}{}
187 \def\color@setgroup{\begingroup\set@color}
188 \ifx\color@gray\@undefined
189 \ifx\color@rgb\@undefined
190 \else
191 \definecolor{black}{rgb}{0,0,0}
192 \definecolor{white}{rgb}{1,1,1}
193 \fi
194 \else
195 \definecolor{black}{gray}{0}
196 \definecolor{white}{gray}{1}
197 \fi
198 \ifx\color@rgb\@undefined\else
199 \definecolor{red}{rgb}{1,0,0}
200 \definecolor{green}{rgb}{0,1,0}
201 \definecolor{blue}{rgb}{0,0,1}
202 \fi
203 \ifx\color@cmyk\@undefined\else
204 \definecolor{cyan}{cmyk}{1,0,0,0}
205 \definecolor{magenta}{cmyk}{0,1,0,0}
206 \definecolor{yellow}{cmyk}{0,0,1,0}
207 \fi
208 \Gin@codes
209 \let\Gin@codes\relax
210 \endinput
211 %%
212 %% End of file `color.sty'.