[pstricks] selective anti-aliasing? (FYI Colours with multido)

Christoph Bersch usenet at bersch.net
Tue May 10 10:18:32 CEST 2011


Hi,

On 10.05.2011 09:57, Christoph Bersch wrote:
> On 10.05.2011 09:10, Carsten Vogel wrote:
>>
>>      Although I am already quite happy with this I like to take
>> programming/style advises.

Here is a suggestion for using only single multido variables and some 
other tunings, I hope I did not overoptimize ;-)

\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{multido}
\usepackage[]{libertine}
\usepackage[]{pstricks}
\usepackage{ifthen}
\usepackage[margin=10mm, left=15mm, right=5mm, nohead, nofoot]{geometry}
\setlength{\parindent}{0pt}
\newcommand{\SetCurrentColor}[4]{%
   \definecolor[ps]{current}{cmyk}{%
      #1 100 div #2 100 div #3 100 div #4 100 div}%
}
\newpsstyle{colorfill}{fillstyle=solid, linewidth=0.5pt, 
linecolor=white, dimen=outer, fillcolor=current}
\SpecialCoor
\begin{document}\pagestyle{empty}
   \multido{\nMagenta=0+10}{11}{%
     \multido{\nBlack=0+10}{10}{%
       {\Large Table Magenta-\nMagenta-\nBlack}\\%
       \begin{pspicture}(-1,1)(17.85, -17.85)
         \psframe(-1,1)(17.85,-17.85)%
         \rput[t](8.925, .9 ){Yellow in \%}
         \rput[l](-0.9, -8.925 ){\rput[t]{90}{Cyan in \%}}
         \multido{\nYellow=0+5}{21}{%
           \rput[b](!\nYellow\space 0.17 mul 0.425 add .2){\nYellow}
           \multido{\nCyan=0+5}{21}{ %
             \ifnum\nYellow=0
               \rput[r](! -0.03 \nCyan\space -0.17 mul 0.425 sub){\nCyan}
             \fi
             \SetCurrentColor{\nCyan}{\nMagenta}{\nYellow}{\nBlack}%
             \rput(!\nYellow\space 0.17 mul \nCyan\space -0.17 mul){%
               \psframe[style=colorfill](0.85, -0.85)
             }%
           }% multido
         }% multido
       \end{pspicture} \newpage%
     }% multido
   }% multido
\end{document}

Christoph



More information about the PSTricks mailing list