1 \section{\Index{Colouring} some single faces}
3 The key value \texttt{\Lkeyword{fcol}=$i_0$~($c_0$) $i_1$~($c_1$) \dots $i_n$~($c_n$)},
4 where $i_k$ are integers and $c_k$ the names of the colours, permits to
5 specify a \Index{colour} for special \Index{faces}.
6 To the face with the index $i_k$ corresponds the colour $c_k$. The
7 integer $n$ must be lower than the maximum of the number of faces of the chosen solid.
10 %% L'option \texttt{[fcol=1 (OliveGreen) 0 (color1) 4 (color2) etc.]}
11 %% permet de sp\'{e}cifier dans l'ordre :
12 %% \begin{compactitem}
13 %% \item le num\'{e}ro de la facette de \texttt{0} \`{a} \texttt{n-1}, pour \texttt{n} facettes ;
14 %% \item la couleur de la facette.
17 The colour names $c_k$, there are $68$~predefined values, are defined names in the
18 \texttt{color.pro}. These values are:
26 \textsl{YellowOrange},
37 \textsl{WildStrawberry},
39 \textsl{CarnationPink},
57 \textsl{CornflowerBlue},
58 \textsl{MidnightBlue},
87 The list of these $68$ colours is available in the command
88 \verb+\colorfaces+ (see an example in the section about
89 the grating of a cube).
91 Thinking on that case, the number of the faces
92 $\mathtt{n_1\times n_2}+2\texttt{(outer faces inner faces)}$
93 must be lower than 68!
95 However users can define their own \Index{colours}. There are two methods:
98 \item They can use one of the $4$~optional arguments \texttt{color1},
99 \texttt{color2}, \texttt{color3}, \texttt{color4} from
100 \Lcs{psSolid}, then transmit to \Lkeyword{fcol} a pair of the type
101 $i$~\verb+(color1)+, where $i$ is the index of the chosen face. The
102 arguments \texttt{color1}, etc. are used in the same way as the
103 arguments from \Lkeyword{color} and \Lkeyword{incolor}.\hfill \break
104 A possible command could be the following:
106 \psSolid[a=1,object=cube,color1=red!60!yellow!20,fcol=0 (color1)]%
108 \item They define their own colour names with the command
109 \verb+\pstVerb+, and then use these names with the argument
110 \Lkeyword{fcol}. For example:
112 \pstVerb{/hetre {0.764 0.6 0.204 setrgbcolor} def
113 /chene {0.568 0.427 0.086 setrgbcolor} def
114 /cheneclair {0.956 0.921 0.65 setrgbcolor} def
119 fcol=0 (hetre) 1 (chene) 2 (cheneclair)
128 \verb+color4+ have default values:
130 \item \textcolor{cyan!50}{color1=cyan!50}
131 \item \textcolor{magenta!60}{color2=magenta!60}
132 \item \textcolor{blue!30}{color3=blue!30}
133 \item \textcolor{red!50}{color4=red!50}
139 \begin{LTXexample}[width=5cm]
140 \psset{Decran=20,viewpoint=10 5 10,unit=0.5}
141 \begin{pspicture}(-5,-5)(5,5)
143 fcol=0 (Apricot) 1 (Aquamarine) 2 (Bittersweet)
144 3 (ForestGreen) 4 (Goldenrod)
151 \begin{LTXexample}[width=4.9cm]
152 \psset{Decran=20,viewpoint=10 5 10,unit=0.5}
153 \begin{pspicture}(-5,-5)(5,5)
155 fcol=0 (Apricot) 2 (Lavender) 3 (SkyBlue) 11 (LimeGreen) 12 (OliveGreen),
162 The choice of the faces to be coloured can be specified with some PostScript code,
164 fcol=48 {i (Black) i 1 add (LimeGreen) i 2 add (Yellow) /i i 3 add store} repeat
166 which will alternately colour the faces in black, green and yellow.
168 \begin{LTXexample}[width=6.5cm]
169 \begin{pspicture}(-3,-3)(3.5,2.5)
170 \psset{Decran=7.5,viewpoint=10 10 5}
171 \pstVerb{/iface 0 store}%
173 fcol=48 {iface (Black)
174 iface 1 add (LimeGreen)
175 iface 2 add (Yellow) /iface
176 iface 3 add store} repeat,
185 When the option \Lkeyword{hue} is activated, the faces of the solid are coloured with the nuance of the rainbow colours.
187 \begin{LTXexample}[width=5.9cm]
188 \begin{pspicture}(-3,-2.5)(3,2.5)
189 \psset[pst-solides3d]{viewpoint=50 50 50,Decran=40,lightsrc=50 20 1e2}
190 \psSolid[r1=5,r0=1,object=tore,ngrid=16 18,hue=0 1]%