pstcol package

David Carlisle

1994/10/27

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}
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⟩