10

I would like to be able to specify the fill color of a psvectorian image instead of having it filled with the background color.

For example, if I would like, say, to color the image of the bird outlined in white with blue!35, how may I do that?

enter image description here

The code which produced the above picture (and is compiled with xelatex) is ---

\documentclass[12pt]{book}
\usepackage{pstricks,psvectorian}
\usepackage{color}

\begin{document}
\thispagestyle{empty}

\begin{pspicture}(-5,-5)(4,4)%
\psframe[fillcolor=brown!65!yellow,fillstyle=solid](-5,-5)(5,12) 
\psframe[linecolor=brown!42!black](-5,-5)(5,12)

% oiseau
\renewcommand*{\psvectorianDefaultColor}{white}%
\rput[tr]{-30}(-1.3,3.75){\psvectorian[width=2.1cm]{57}}
\end{pspicture}%
\end{document}

3 Answers 3

9

You could try an overlap with a very slight kern, perhaps.

oiseau

MWE

\documentclass[12pt]{book}
\usepackage{pstricks,psvectorian}
\usepackage{color}

\begin{document}
\thispagestyle{empty}

\begin{pspicture}(-5,-5)(4,4)%
\psframe[fillcolor=brown!65!yellow,fillstyle=solid](-5,-5)(5,12) 
\psframe[linecolor=brown!42!black](-5,-5)(5,12)

% oiseau
\renewcommand*{\psvectorianDefaultColor}{white}%
\rput[tr]{-30}(-1.3,3.75){\psvectorian[width=2.1cm,color=blue]{57}\kern0.35pt\llap{\psvectorian[width=2.1cm,color=red]{57}}
}
\end{pspicture}%
\end{document}

Detail:

detail

7

For fun with Asymptote.

Run with asy -f pdf <file name>.asy.

Update

settings.tex="xelatex";
usepackage("pstricks");
usepackage("psvectorian");

path[] g=texpath("\psvectorian[width=2.1cm,color=blue]{57}");
pen[] colors={red, green, blue, orange, cyan, magenta, gray};
colors.cyclic=true;

picture pic;
size(pic,5cm);
for (int i=0; i<g.length; ++i)
 fill(pic,g[i],colors[i]);

frame f=rotate(-30)*align(pic.fit(),dir(-135));
add(f,(-1.3,3.75));
add(reflect((-1.3,3.75),(-1.3,3.75)+(0,0.1))*f,(-1.3,3.75));
dot(Label("$(-1.3,3.75)$"),(-1.3,3.75),N,Fill(red));

shipout(bbox(mm,Fill(0.35*brown+0.65*yellow+opacity(.7))));

enter image description here

settings.tex="xelatex";
usepackage("pstricks");
usepackage("psvectorian");
unitsize(1cm);

path[] g=texpath("\psvectorian[width=2.1cm,color=blue]{57}");
pen[] colors={red, green, blue, orange, cyan, magenta, gray};
colors.cyclic=true;

for (int i=0; i<g.length; ++i)
 filldraw(g[i],colors[i]);

enter image description here

5
\psvectorian[width=2.1cm,color=red]{57}

is the right way to change the line color. However, there is no fillcolor because nearly all symbols have no closed curve!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .