pstcol package^{∗}

David Carlisle

1996/10/28

Abstract

Hopefully temporary package modifying PSTricks colour interface to work with standard LaTeX colours.

1 ⟨∗package⟩

Require PSTricks

 2 \let\saved@gray\color@gray
 3 \RequirePackage{pstricks}
 4 \let\color@gray\saved@gray

Require Colour

 5 \DeclareOption*{\PassOptionsToPackage\CurrentOption{color}}
 6 \ProcessOptions
 7 \RequirePackage{color}

Redefine PST access functions in terms of color.sty

 8 \def\pst@getcolor#1#2{%
 9 \@ifundefined{\string\color@#1}%
10 {\@pstrickserr{Color `#1' not defined}\@eha}%
11 {\edef#2{\expandafter\expandafter\expandafter
12  \c@lor@to@ps\csname\string\color @#1\endcsname\@@}}}
13 \def\pst@usecolor#1{#1\space}

Redefine some predefined colors that are in pst but not in color.sty

14 \definecolor{darkgray}{gray}{.25}
15 \definecolor{gray}{gray}{.5}
16 \definecolor{lightgray}{gray}{.75}
17 \definecolor{gradbegin}{rgb}{0,1,1}
18 \definecolor{gradend}{rgb}{0,.1,.95}

Redeclare the default colours with the new definitions.

19 \psset@bordercolor{white}
20 \psset@doublecolor{white}
21 \psset@linecolor{black}

∗This file has version number v1.0, last revised 1996/10/28.

22 \psset@fillcolor{white}
23 \psset@hatchcolor{black}
24 \psset@gridcolor{black}
25 \psset@gridlabelcolor{black}
26 \psset@shadowcolor{darkgray}
27 \psset@subgridcolor{gray}

Redefine the PST user-definition commands in terms of \definecolor

28 \def\newgray#1{%
29 \definecolor{#1}{gray}}
30 \def\newrgbcolor#1#2{%
31 \newrgbcolorx{#1}#2\@@}
32 \def\newrgbcolorx#1#2 #3 #4\@@{%
33 \definecolor{#1}{rgb}{#2,#3,#4}}
34 \def\newcmykcolor#1#2{%
35 \newcmykcolorx{#1}#2\@@}
36 \def\newcmykcolorx#1#2 #3 #4 #5\@@{%
37 \definecolor{#1}{cmyk}{#2,#3,#4,#5}}

38 ⟨/package⟩

Change History

v0.1

General: Initial version . . . . . . . . 1 v1.0

General: Documentation improvements . . . . . . . . . . . . . . . . . . . 1

Index

Numbers written in italic refer to the page where the corresponding entry is described, the ones underlined to the code line of the definition, the rest to the code lines where the entry is used.

Symbols

\@@ … 12, 31, 32, 35, 36 \@eha . . . . . . . . . . . . 10

\@ifundefined . . . . . . 9
\@pstrickserr . . . . . 10

C

\c@lor@to@ps . . . . . . 12

\color . . . . . . . . . . . 12 \color@ . . . . . . . . . . . 9

\color@gray . . . . . . 2, 4

\csname . . . . . . . . . . 12

\CurrentOption . . . . . 5

D

                          \DeclareOption . . . . . 5

\def . . . . . . . . 8, 13,

28, 30, 32, 34, 36

                          \definecolor . . . . . .

. 14–18, 29, 33, 37

E \edef . . . . . . . . . . . . 11

                          \endcsname . . . . . . . 12
                          \expandafter . . . . . . 11

L \let . . . . . . . . . . . . 2, 4

N

                                                   \newcmykcolor . . . . . 34
                                                   \newcmykcolorx . . 35, 36

\newgray . . . . . . . . . 28

                                                   \newrgbcolor . . . . . . 30
                                                   \newrgbcolorx . . . 31, 32

P

                                                   \PassOptionsToPackage

. . . . . . . . . . . . . 5

\ProcessOptions . . . . 6
\psset@bordercolor . 19
\psset@doublecolor . 20
\psset@fillcolor . . 22
\psset@gridcolor . . 24
\psset@gridlabelcolor

. . . . . . . . . . . . 25

                          \psset@hatchcolor . 23
                          \psset@linecolor . . 21
                          \psset@shadowcolor . 26
                          \psset@subgridcolor 27
                          \pst@getcolor . . . . . . 8
                          \pst@usecolor . . . . . 13

R

                                                   \RequirePackage . . 3, 7

S

                                                   \saved@gray . . . . . . 2, 4

\space . . . . . . . . . . . 13 \string . . . . . . . . . 9, 12