summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/graphics/pstcol.dtx
blob: 7fba93a1dd1d1d659ad67ee07b127cd23ec6d9d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
%
% \iffalse
%
%% pstcol.dtx Copyright (C) 1994--1996 1999 David Carlisle
%%
%% 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.0 or, at your option, any later version.
%%
%<*dtx>
          \ProvidesFile{pstcol.dtx}
%</dtx>
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{pstcol}
%<driver> \ProvidesFile{pstcol.drv}
% \fi
%         \ProvidesFile{pstcol.dtx}
          [2001/06/20 v1.1 PSTricks color colompatibility (DPC)]
%
% \iffalse
%<*driver>
\documentclass{ltxdoc}
\begin{document}
\DocInput{pstcol.dtx}
\end{document}
%</driver>
% \fi
%
% \CheckSum{98}
% 
% \GetFileInfo{pstcol.dtx}
%
% \changes{v0.1}{1994/10/27}
%     {Initial version}
% \changes{v1.0}{1996/10/28}
%     {Documentation improvements}
%
% \title{\textsf{pstcol} package\thanks{This file
%        has version number \fileversion, last
%        revised \filedate.}}
% \author{David Carlisle}
% \date{\filedate}
%
%
% \maketitle
%
% \begin{abstract}
% Hopefully temporary package modifying PSTricks colour interface to
% work with standard LaTeX colours.
% \end{abstract}
%
% \StopEventually{}
%
%    \begin{macrocode}
%<*package>
%    \end{macrocode}
%
% Require PSTricks
%%%%%%%%%%%%%%%%%%
%    \begin{macrocode}
\let\saved@gray\color@gray
\RequirePackage{pstricks}
\let\color@gray\saved@gray
%    \end{macrocode}
%
% Require Colour
%%%%%%%%%%%%%%%%
%    \begin{macrocode}
\DeclareOption*{\PassOptionsToPackage\CurrentOption{color}}
\ProcessOptions
\RequirePackage{color}
%    \end{macrocode}
%
% Redefine PST access functions in terms of color.sty
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%    \begin{macrocode}
\def\pst@getcolor#1#2{%
\@ifundefined{\string\color@#1}%
{\@pstrickserr{Color `#1' not defined}\@eha}%
 {\edef#2{\expandafter\expandafter\expandafter
         \c@lor@to@ps\csname\string\color @#1\endcsname\@@}}}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\pst@usecolor#1{#1\space}
%    \end{macrocode}
%
% Redefine some predefined colors that are in pst but not in color.sty
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%    \begin{macrocode}
\definecolor{darkgray}{gray}{.25}
\definecolor{gray}{gray}{.5}
\definecolor{lightgray}{gray}{.75}
\definecolor{gradbegin}{rgb}{0,1,1}
\definecolor{gradend}{rgb}{0,.1,.95}
%    \end{macrocode}
%
% Redeclare the default colours with the new definitions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%    \begin{macrocode}
\psset@bordercolor{white}
\psset@doublecolor{white}
\psset@linecolor{black}
\psset@fillcolor{white}
\psset@hatchcolor{black}
\psset@gridcolor{black}
\psset@gridlabelcolor{black}
\psset@shadowcolor{darkgray}
\psset@subgridcolor{gray}
%    \end{macrocode}
%
%
% Redefine the PST user-definition commands in terms of |\definecolor|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%    \begin{macrocode}
\def\newgray#1{%
  \definecolor{#1}{gray}}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\newrgbcolor#1#2{%
  \newrgbcolorx{#1}#2\@@}
\def\newrgbcolorx#1#2 #3 #4\@@{%
  \definecolor{#1}{rgb}{#2,#3,#4}}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\newcmykcolor#1#2{%
  \newcmykcolorx{#1}#2\@@}
\def\newcmykcolorx#1#2 #3 #4 #5\@@{%
  \definecolor{#1}{cmyk}{#2,#3,#4,#5}}
%    \end{macrocode}
%
% \changes{v1.1}{2001/06/20}{Added redefinitions for PSTricks' 
%                     predefined color commands (CAR) graphics/3233}
% Finally, redefine some predefined user commands from pst
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%    \begin{macrocode}
\renewcommand\black    {\color{black}}
\renewcommand\darkgray {\color{darkgray}}
\renewcommand\gray     {\color{gray}}
\renewcommand\lightgray{\color{lightgray}}
\renewcommand\white    {\color{white}}
\renewcommand\blue     {\color{blue}}
\renewcommand\red      {\color{red}}
\renewcommand\green    {\color{green}}
\renewcommand\yellow   {\color{yellow}}
\renewcommand\magenta  {\color{magenta}}
\renewcommand\cyan     {\color{cyan}}
%    \end{macrocode}
%
%    \begin{macrocode}
%</package>
%    \end{macrocode}
%
% \Finale
%