Debian Codegraph @

texk/web2c/hitexdir/tex/hitex.def

raw
1 %%
2 %% This work may be distributed and/or modified under the
3 %% conditions of the LaTeX Project Public License, either version 1.3c
4 %% of this license or (at your option) any later version.
5 %% The latest version of this license is in
6 %% http://www.latex-project.org/lppl.txt
7 %% and version 1.3c or later is part of all distributions of LaTeX
8 %% version 2005/12/01 or later.
9 %%
10 %% This work has the LPPL maintenance status `maintained'.
11 %%
12 %% The Current Maintainer of this work is the LaTeX3 Project.
13 %%
14 %% https://github.com/latex3/graphics-def/issues
15 %%
16
17 % VERY MINIMAL hitex file for color/graphics
18 \ProvidesFile{hitex.def}
19 [2023/04/17 v0.1a Graphics/color driver for hitex]
20
21 \def\c@lor@arg#1{%
22 \dimen@#1\p@
23 \ifdim\dimen@<\z@\dimen@\maxdimen\fi
24 \ifdim\dimen@>\p@
25 \PackageError{color}{Argument `#1' not in range [0,1]}\@ehd
26 \fi}
27
28 \global\def\current@color{0 0 0}
29 \def\set@color{%\message{Set:\current@color.}
30 \HINTcolor{\current@color}%
31 \aftergroup\reset@color}
32 \def\set@page@color{%\message{Set page:\current@color.}
33 \HINTcolor{\current@color}%
34 \aftergroup\reset@color}
35 \def\reset@color{%\message{Reset()}
36 \HINTendcolor}%
37
38 \def\hi@color@warn{%
39 \PackageWarning{color}{color not supported\@gobble}%
40 \global\let\hi@color@warn\relax}
41
42 % Thanks to Ulrike Fischer
43 \def\color@named#1#2{\c@lor@@named#2,,\@@#1}
44 \def\define@color@named#1#2%
45 {\let\@@cls\@empty\@namedef{\@backslashchar color@#1}{{}{}{#2}{}{}}}
46 \def\c@lor@@named#1,#2,#3\@@#4%
47 {\edef#4{\expandafter\expandafter\expandafter\@thirdoffive
48 \csname\@backslashchar color@#1\endcsname}}
49
50
51 \def\color@rgb#1#2{\c@lor@@rgb#2\@@#1}
52 \def\c@lor@@rgb#1,#2,#3\@@#4{%
53 \c@lor@arg{#1}%
54 \c@lor@arg{#2}%
55 \c@lor@arg{#3}%
56 \edef#4{fg{#1 #2 #3}}%
57 }
58
59 \def\color@RGB#1#2{\c@lor@@RGB#2\@@#1}
60 \def\c@lor@@RGB#1,#2,#3\@@#4{%
61 \c@lor@arg{#1}%
62 \c@lor@arg{#2}%
63 \c@lor@arg{#3}%
64 \edef#4{FG{#1 #2 #3}}%
65 }
66
67
68 \def\color@cmyk#1#2{\c@lor@@cmyk#2\@@#1}
69 \def\c@lor@@cmyk#1,#2,#3,#4\@@#5{%
70 \c@lor@arg{#4}%
71 \c@lor@arg{#1}%
72 \c@lor@arg{#2}%
73 \c@lor@arg{#3}%
74 \edef#5{fg{cmyk #1 #2 #3 #4}}%
75 }
76
77 \def\color@gray#1#2{%
78 \c@lor@arg{#2}%
79 \edef#1{fg{#2 #2 #2}}%
80 }
81
82
83 \def\Gin@extensions{.png,.jpg}
84 \@namedef{Gin@[email protected]}#1{{png}{.png}{#1}}
85 \@namedef{Gin@[email protected]}#1{{jpg}{.jpg}{#1}}
86
87
88 \def\Gread@png#1{%
89 \setbox\@tempboxa\hbox{\HINTimage=#1\relax}%
90 \def\Gin@llx{0}\let\Gin@lly\Gin@llx
91 \Gin@defaultbp\Gin@urx{\wd\@tempboxa}% = 0...
92 \Gin@defaultbp\Gin@ury{\ht\@tempboxa}% = 0...
93 %\def\Gin@urx{72}\let\Gin@ury\Gin@urx
94 \Gin@nat@height\Gin@ury bp
95 \Gin@nat@width\Gin@urx bp
96 }
97
98 \def\Ginclude@png#1{%
99 \mbox{\HINTimage=#1 width \Gin@req@width height\Gin@req@height\relax}%
100 }
101
102 \let\Gread@jpg\Gread@png
103 \let\Ginclude@jpg\Ginclude@png
104
105 \endinput