From: Hans Hagen <j.hagen@xs4all.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
Fabrice Couvreur <fabrice1.couvreur@gmail.com>
Subject: Re: Metapost and TikZ color code equivalent
Date: Sat, 15 Feb 2020 21:48:53 +0100 [thread overview]
Message-ID: <37cdcc88-1f52-32da-2ebc-27934379f930@xs4all.nl> (raw)
In-Reply-To: <CACyK-eqT9KSUTGGuc0XoaT2Bg00qZtBwn_5pyB0XpqaqoRM34A@mail.gmail.com>
On 2/15/2020 12:25 PM, Fabrice Couvreur wrote:
> Hi Henri,
> Why does the blue path not rotate 90 with the draw command but rotate
> with the fill command?
compare
draw origin -- (0,0.2cm) -- (4cm,0.2cm) -- (4cm,0) --
(4.1cm,-0.05cm) -- (0.1cm,-0.05cm) -- cycle rotated alpha withcolor red;
draw (origin -- (0,0.2cm) -- (4cm,0.2cm) -- (4cm,0) --
(4.1cm,-0.05cm) -- (0.1cm,-0.05cm) -- cycle) rotated alpha withcolor blue;
> \startMPcode
>
> def match (expr alpha, pos) =
> fill unitsquare xscaled 4cm yscaled 0.2cm rotated alpha shifted pos
> withcolor yellow ;
> fill origin -- (4cm,0) -- (4.1cm,-0.05cm) -- (0.1cm,-0.05cm) --
> cycle rotated alpha withcolor(.6yellow + black);
> draw origin -- (0,0.2cm) -- (4cm,0.2cm) -- (4cm,0) -- (4.1cm,-0.05cm)
> -- (0.1cm,-0.05cm) -- cycle rotated alpha withcolor blue;
> draw origin -- (0,0.2cm) -- (4cm,0.2cm) -- (4cm,0) -- (4.1cm,-0.05cm)
> -- (0.1cm,-0.05cm) -- cycle rotated alpha withcolor blue;
> draw fullcircle xscaled 0.50cm yscaled 0.44cm shifted (4.125cm,0.1cm)
> rotated alpha;
> draw fullcircle xscaled 0.50cm yscaled 0.44cm shifted (4.125cm,0.1cm)
> rotated alpha
> withshademethod "circular 1"
> withshadevector (0,1)
> withshadecolors (red,white);
> enddef;
> match(0,(0,0));
> match(90,(4.2cm,0));
> match(90,(0,0));
> match(0,(0,4.2cm));
>
> \stopMPcode-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________
prev parent reply other threads:[~2020-02-15 20:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-13 21:45 Fabrice Couvreur
2020-02-14 1:49 ` Henri Menke
2020-02-14 11:41 ` Fabrice Couvreur
2020-02-14 15:43 ` Fabrice L
2020-02-14 23:01 ` Fabrice Couvreur
2020-02-15 11:25 ` Fabrice Couvreur
2020-02-15 12:25 ` Floris van Manen
2020-02-15 20:48 ` Hans Hagen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=37cdcc88-1f52-32da-2ebc-27934379f930@xs4all.nl \
--to=j.hagen@xs4all.nl \
--cc=fabrice1.couvreur@gmail.com \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).