![](https://secure.gravatar.com/avatar/d7c3317235884569312c31f786d43bbc.jpg?s=120&d=mm&r=g)
i Henri,
Thank you for your answer. The idea is to make the graph as an attachment. I
converted to Metapost but the road is still long!
The code is from percusse on StackExchange. As you can see, there is a
problem with the ellipse. How do I fix this ?
Thank you
Fabrice
\usemodule[tikz]
\starttext
\startMPcode
def match (expr pos) =
fill unitsquare xscaled 4cm yscaled 0.2cm shifted pos withcolor yellow;
fill origin -- (4cm,0) -- (4.1cm,-0.05cm) -- (0.1cm,-0.05cm) -- cycle
withcolor(.6yellow + black);
draw origin -- (0,0.2cm) -- (4cm,0.2cm) -- (4cm,0) -- (4.1cm,-0.05cm)
-- (0.1cm,-0.05cm) -- cycle;
fill fullcircle xscaled 0.25cm yscaled 0.22cm shifted (4.125cm,0.1cm)
withcolor red;
draw fullcircle xscaled 0.25cm yscaled 0.22cm shifted (4.125cm,0.1cm)
withshademethod "circular"
withshadevector (0,1)
withshadecolors (red,white)
enddef;
match((0,0));
\stopMPcode
\starttikzpicture
\define[2]\allumette{
\fill [yellow] (#1,#2) rectangle (#1+4,#2+0.2);
\fill [yellow!60!black] (#1,#2) -- ++(4,0)-- ++(0.1,-0.05) -- ++(-4,0)
-- ++(-0.1,0.05);
\draw (#1,#2) -- ++(0,0.2) -- ++(4,0) -- ++(0,-0.2) -- ++(0.1,-0.05) --
++(-4,0) -- ++(-0.1,0.05);
\shade[ball color=red] (#1+4,#2+0.1) ellipse (0.25cm and 0.22cm);
\draw (#1+4,#2+0.1) ellipse (0.25cm and 0.22cm);
}
\allumette{0.1}{0.2}
\filldraw[orange,scale=0.5,shift={(8.2,1.2)}] (0,0) .. controls
(-1.5,1.25) and (.5,2) .. (-.2,4) .. controls (1,2.5) and (1,.5) .. (0,0);
\stoptikzpicture
\stoptext
Le ven. 14 févr. 2020 à 02:49, Henri Menke
On 2/14/20 10:45 AM, Fabrice Couvreur wrote:
Hi, How to have the color defined by {yellow!60!black} with Metapost ?
\usemodule[tikz] \starttext \startMPcode fill fullsquare scaled 1cm withcolor (.6yellow + black) ; \stopMPcode
\starttikzpicture \fill[yellow!60!black] (0,0) rectangle (1,1); \stoptikzpicture \stoptext
Thank you. Fabrice
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net
___________________________________________________________________________________
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net
___________________________________________________________________________________