[pstricks] Re: density fill
Denis Girou
Denis.Girou at idris.fr
Fri Nov 15 18:11:25 CET 2002
The following message is a courtesy copy of an article
that has been posted to comp.text.tex as well.
>>>>> "les" == abidnego25 <abidnego25 at yahoo.com> writes:
les> how can i use
les> pstricks and draws a circle with dots filled with a given
les> density (argument to the macro).
les> so if density =1 the circle is a solid
les> if density = 0, the circle is transparent and
les> then it increasing amount of opaqueness as one increases
les> the value from 0 --> 1
You can use the Saturation value of the HSB color model for such purpose
(if I understand correctly your wish):
\documentclass[a4paper]{article}
\usepackage{multido}
\usepackage{pstcol}
\def\PstFillCircleA#1{%
\definecolor{MyColor}{hsb}{1,#1,1}%
\pspicture(-0.5,-0.5)(0.5,0.5)
\pscircle[fillstyle=solid,fillcolor=MyColor]{0.5}
\endpspicture}
\def\PstFillCircleB#1#2{%
\definecolor{MyColor}{hsb}{#1,#2,1}%
\pspicture(-0.5,-0.5)(0.5,0.5)
\pscircle[fillstyle=solid,fillcolor=MyColor]{0.5}
\endpspicture}
\setlength{\parindent}{0cm}
\pagestyle{empty}
\begin{document}
\multido{\nCount=1+-0.1}{11}{\PstFillCircleA{\nCount}}
\vspace{3cm}
\multido{\nCountA=1+-0.1}{11}{%
\multido{\nCountB=1+-0.1}{11}{%
\PstFillCircleB{\nCountA}{\nCountB}}\\}
\end{document}
Denis Girou
--
--------------------------------------------------------------------------
Institut du Développement et des Ressources en Informatique Scientifique |
Centre National de la Recherche Scientifique |
Bâtiment 506 - B.P. 167 - 91403 Orsay Cedex - France |
--------------------------------------------------------------------------
More information about the PSTricks
mailing list