| 1 |
%% |
| 2 |
%% This is file `xcolor2.tex', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% xcolor.dtx (with options: `test2') |
| 8 |
%% |
| 9 |
%% IMPORTANT NOTICE: |
| 10 |
%% |
| 11 |
%% For the copyright see the source file. |
| 12 |
%% |
| 13 |
%% Any modified versions of this file must be renamed |
| 14 |
%% with new filenames distinct from xcolor2.tex. |
| 15 |
%% |
| 16 |
%% For distribution of the original source see the terms |
| 17 |
%% for copying and modification in the file xcolor.dtx. |
| 18 |
%% |
| 19 |
%% This generated file may be distributed as long as the |
| 20 |
%% original source files, as listed above, are part of the |
| 21 |
%% same distribution. (The sources need not necessarily be |
| 22 |
%% in the same archive or directory.) |
| 23 |
%% |
| 24 |
\ProvidesFile{xcolor2} |
| 25 |
[2024/09/29 v3.02 Pstricks color test (UK)] |
| 26 |
%% |
| 27 |
%% ---------------------------------------------------------------- |
| 28 |
%% Copyright (C) 2003-2021 by Dr. Uwe Kern <xcolor at ukern dot de> |
| 29 |
%% 2021-2024 LaTeX Project https://github.com/latex3/xcolor/issues |
| 30 |
%% ---------------------------------------------------------------- |
| 31 |
%% |
| 32 |
\def\XCfileversion{v3.02}% |
| 33 |
\def\XCfiledate{2024/09/29}% |
| 34 |
|
| 35 |
\listfiles |
| 36 |
\documentclass{article} |
| 37 |
|
| 38 |
\usepackage{pstricks,pst-tree,pst-slpe,multido} |
| 39 |
\makeatletter |
| 40 |
\makeatother |
| 41 |
\usepackage{fancyvrb-ex} |
| 42 |
|
| 43 |
\def\textfraction{0.01} |
| 44 |
\def\topfraction{0.99} |
| 45 |
\def\bottomfraction{0.99} |
| 46 |
\def\floatpagefraction{0.70} |
| 47 |
\setlength\abovecaptionskip{12pt} |
| 48 |
\setlength\belowcaptionskip{10pt} |
| 49 |
\parindent0pt |
| 50 |
|
| 51 |
\begin{document} |
| 52 |
\title{Color extensions with the \textsf{xcolor} package --- \textsf{pstricks} examples} |
| 53 |
\author{Dr. Uwe Kern\thanks{This file is part of the \textsf{xcolor} distribution which can be downloaded from the CTAN mirrors (\texttt{macros/latex/contrib/xcolor/}) or the homepage \texttt{www.ukern.de/tex/xcolor.html}. Please send error reports and suggestions for improvements to \texttt{https://github.com/latex3/xcolor/issues}.}} |
| 54 |
\date{\XCfileversion{} (\XCfiledate)} |
| 55 |
\maketitle |
| 56 |
|
| 57 |
\centerline{\fcolorbox{red}{yellow!50}{This document is not suitable for pdf\LaTeX! Please use \LaTeX{} + \texttt{dvips} etc.}} |
| 58 |
|
| 59 |
\begin{figure}[htb]\caption{Modified version of an example from the \textsf{pstricks} manual; requires \textsf{pst-tree}} |
| 60 |
\begin{SideBySideExample}[fontsize=\footnotesize,xrightmargin=.45\textwidth] |
| 61 |
\begin{pspicture}(-0.5,-2)(3,2) |
| 62 |
\cnode(0,0){.5cm}{root} |
| 63 |
\cnode*[linecolor=red](3,1.5){4pt}{A} |
| 64 |
\cnode*[linecolor=red!72.5375!blue](3,0){4pt}{B} |
| 65 |
\cnode*[linecolor=-red](3,-1.5){4pt}{C} |
| 66 |
\psset{nodesep=3pt} |
| 67 |
\ncline[linecolor=green!50!red]{root}{A} |
| 68 |
\ncline[linecolor=blue]{root}{B} |
| 69 |
\ncline[linecolor=-green!50!red]{root}{C} |
| 70 |
\end{pspicture} |
| 71 |
\end{SideBySideExample} |
| 72 |
\end{figure} |
| 73 |
|
| 74 |
\begin{figure}[htb]\caption{Moving from one color to its complement; requires \textsf{pst-slpe}} |
| 75 |
\begin{SideBySideExample}[fontsize=\footnotesize,xrightmargin=.45\textwidth] |
| 76 |
\begin{pspicture}(4,1) |
| 77 |
\psframe[fillstyle=slope, |
| 78 |
slopeangle=30, |
| 79 |
slopebegin=red!72.5375!blue, |
| 80 |
slopeend=-red!72.5375!blue](4,1) |
| 81 |
\end{pspicture} |
| 82 |
\end{SideBySideExample} |
| 83 |
\end{figure} |
| 84 |
|
| 85 |
\begin{figure}[htb]\caption{Explicit color specification via a loop command; requires \textsf{multido}} |
| 86 |
\begin{SideBySideExample}[fontsize=\footnotesize,xrightmargin=.45\textwidth] |
| 87 |
\psset{unit=1.75}% |
| 88 |
\begin{pspicture}(0,-1)(2,1) |
| 89 |
\multido{\rHue=0.00+0.01}{100}% |
| 90 |
{\pscircle[linewidth=0.01, |
| 91 |
linecolor={[hsb]{\rHue,1,1}}](1,0){\rHue}} |
| 92 |
\end{pspicture} |
| 93 |
\end{SideBySideExample} |
| 94 |
\end{figure} |
| 95 |
|
| 96 |
\begin{figure}[htb]\caption{Color series --- modified version of an example from the \textsf{pst-fill} manual; note that the \texttt{\string\multirput} command does not give the desired result here} |
| 97 |
\begin{SideBySideExample}[fontsize=\footnotesize,xrightmargin=.45\textwidth] |
| 98 |
\newcommand*\Sheep |
| 99 |
{\begin{pspicture}(3,1.5) |
| 100 |
\pscustom[liftpen=2,fillstyle=solid,fillcolor=sheep!!+]% |
| 101 |
{\pscurve(0.5,-0.2)(0.6,0.5)(0.2,1.3)(0,1.5)(0,1.5) |
| 102 |
(0.4,1.3)(0.8,1.5)(2.2,1.9)(3,1.5)(3,1.5)(3.2,1.3) |
| 103 |
(3.6,0.5)(3.4,-0.3)(3,0)(2.2,0.4)(0.5,-0.2)} |
| 104 |
\pscircle*(2.65,1.25){0.12\psunit}% Eye |
| 105 |
\psccurve*(3.5,0.3)(3.35,0.45)(3.5,0.6)(3.6,0.4)% Muzzle |
| 106 |
\pscurve(3,0.35)(3.3,0.1)(3.6,0.05)% Mouth |
| 107 |
\pscurve(2.3,1.3)(2.1,1.5)(2.15,1.7) |
| 108 |
\pscurve(2.1,1.7)(2.35,1.6)(2.45,1.4)% Ear |
| 109 |
\end{pspicture}} |
| 110 |
\definecolorseries |
| 111 |
{sheep}{rgb}{step}[rgb]{.95,.85,.55}{.17,.47,.37} |
| 112 |
\resetcolorseries{sheep} |
| 113 |
\psset{unit=0.4} |
| 114 |
\begin{pspicture}(-3,-6)(0,7.5) |
| 115 |
\Multido{\ry=6.0+-1.5}{5}% |
| 116 |
{\rput(0,\ry){\Multido{}{5}{\Sheep}}} |
| 117 |
\resetcolorseries{sheep}% |
| 118 |
\multirput(-6,-6)(3,0)5{\Sheep} |
| 119 |
\end{pspicture} |
| 120 |
\end{SideBySideExample} |
| 121 |
\end{figure} |
| 122 |
|
| 123 |
\begin{figure}[htb]\caption{Interaction with native PostScript code --- $\gamma$-corrected wavelengths} |
| 124 |
\begin{Example}[fontsize=\footnotesize,xrightmargin=.45\textwidth] |
| 125 |
\newcount\WL \unitlength.75pt |
| 126 |
\def\WaveToPS#1% |
| 127 |
{\definecolor{tmp}{rgb:wave}{#1}\extractcolorspecs{tmp}\tmpm\tmpc |
| 128 |
\expandafter\WaveToPSi\tmpc,} |
| 129 |
\def\WaveToPSi#1,#2,#3,{\pstVerb{/Red{#1}def /Green{#2}def /Blue{#3}def}} |
| 130 |
\def\DisplayBar#1#2% |
| 131 |
{\linethickness{1.25\unitlength}\WL=360 |
| 132 |
\pstVerb{/Gamma{#1}def}% |
| 133 |
\multiput(360,#2)(1,0){456}% |
| 134 |
{\WaveToPS{\the\WL}{\color{lambda}\line(0,1){50}}\global\advance\WL1}% |
| 135 |
\linethickness{0.25\unitlength}\WL=360 |
| 136 |
\multiput(360,#2)(20,0){23}% |
| 137 |
{\picture(0,0) |
| 138 |
\line(0,-1){5}\multiput(5,0)(5,0){3}{\line(0,-1){2.5}}% |
| 139 |
\put(0,-10){\makebox(0,0){\the\WL}}\global\advance\WL20 |
| 140 |
\endpicture}% |
| 141 |
\put(350,#2){\makebox(0,50)[r]{\small$\gamma$\,=\,#1}}} |
| 142 |
\pstVerb{/Corr{dup 0 gt {Gamma exp}if}def} |
| 143 |
\definecolor[ps]{lambda}{rgb}{Red Corr Green Corr Blue Corr}% |
| 144 |
\begin{picture}(510,345)(310,-10) |
| 145 |
\sffamily\tiny |
| 146 |
\DisplayBar{0.4}{0}% |
| 147 |
\DisplayBar{0.6}{70}% |
| 148 |
\DisplayBar{0.8}{140}% |
| 149 |
\DisplayBar{1.0}{210}% |
| 150 |
\DisplayBar{1.2}{280}% |
| 151 |
\end{picture} |
| 152 |
\end{Example} |
| 153 |
\end{figure} |
| 154 |
|
| 155 |
\end{document} |
| 156 |
\endinput |
| 157 |
%% |
| 158 |
%% End of file `xcolor2.tex'. |