From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/106301 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Fabrice Couvreur Newsgroups: gmane.comp.tex.context Subject: Re: Metapost and TikZ color code equivalent Date: Sat, 15 Feb 2020 12:25:23 +0100 Message-ID: References: <2F811711-44BC-466B-8DA8-76D5361FEBA6@gmail.com> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8305031222881587786==" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="74240"; mail-complaints-to="usenet@ciao.gmane.io" To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Feb 15 12:28:29 2020 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j2vcb-000JDo-Dr for gctc-ntg-context-518@m.gmane-mx.org; Sat, 15 Feb 2020 12:28:29 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 9907A181D9D; Sat, 15 Feb 2020 12:28:15 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pGuCjpTbuV3b; Sat, 15 Feb 2020 12:28:14 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id A2116181D92; Sat, 15 Feb 2020 12:28:14 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 167DA181D92 for ; Sat, 15 Feb 2020 12:28:13 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vWqiziRxiUUh for ; Sat, 15 Feb 2020 12:28:12 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.221.48; helo=mail-wr1-f48.google.com; envelope-from=fabrice1.couvreur@gmail.com; receiver= Original-Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 1C3CB181D91 for ; Sat, 15 Feb 2020 12:28:12 +0100 (CET) Original-Received: by mail-wr1-f48.google.com with SMTP id w12so14034304wrt.2 for ; Sat, 15 Feb 2020 03:28:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=xbrcy9g1++rWG/WtmkllwNPFPTctSDWmSrDhuU8X+aw=; b=nEJkExC6ho7bHz3FYnEveZ2/OqS3Fgte1iGeKaPNsVgrF6sqIQUSIrvKslvjOcrFLz xMS7EWnfsu2Nlvg03mDoUAAN8O7R1NmL6hghKEH3TYiAGu1fDJkmPkJO+PPzjxEfFiYB YLkwQoAYUv75InceER2rxhsvaKP1hurcyBNN3a0JxGaqVPJc2c2X9LgU8PZaHgeGgAry NQvdd+k1GuclKQAztoYQfT/dnnutVA986R4X1vI0+JJGsMmCxOjkG3Q+YouBTnVl7C1B 1CnQpHwDu+w0ST4rOBZyAADV8jc861cxH5KwBQdb3SEs9I7UC9HjDwrCJTIfmyAd/kT8 0oWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=xbrcy9g1++rWG/WtmkllwNPFPTctSDWmSrDhuU8X+aw=; b=bizmg0luHsXz045agQh5kAXT9oJle1qcbS2egtSfQKt2FNXkLfeh74aZit+Q69hNti pSJzaNiaELaSJcnNk//19gA7XPTSgavreD/birZPUxFzCr9KH69D/sha6dwUMsK4ofP8 N6iE0f5FSD2a2bExk7axxfMcK0ZH4/s44XOPXRxWElrLCQYKZFzt3JgbXvsNVKwnmMTd 3WRKBG3Bpj+pxEKeOf3e0cT+cTxgk4tbK5pMYluxzxcQ84gxKpz6sZgwZJ6BM7jxxjmD n9J3GVtll+zTTG4kaaxHqRcMmIRO1Yai2zXBwOD6F1J96/SujvpNqsQ7YM+P6zqlqxta 8IWw== X-Gm-Message-State: APjAAAVd64mk6cWhmy77ewReuGuFiASVEUXDlCXggnV6J41VnuOIXpAv idjBjS0s7/4Xc7wrIWFbIvG9Zyqw3vXAniAvV1FqvL+Zr2I= X-Google-Smtp-Source: APXvYqyAvDD9Ig1enHz4pPjXAGV5Egtua8K0OjDjDYiVFQSO37GYMdbio8sNUcuHzKmM90NlZW8tzvciH7j3h2gKcas= X-Received: by 2002:a5d:61cf:: with SMTP id q15mr9609562wrv.74.1581766091267; Sat, 15 Feb 2020 03:28:11 -0800 (PST) In-Reply-To: X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:106301 Archived-At: --===============8305031222881587786== Content-Type: multipart/alternative; boundary="000000000000fce033059e9b9d3d" --000000000000fce033059e9b9d3d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Henri, Why does the blue path not rotate 90 with the draw command but rotate with the fill command ? \startMPcode def match (expr alpha, pos) =3D 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 Le sam. 15 f=C3=A9vr. 2020 =C3=A0 00:01, Fabrice Couvreur a =C3=A9crit : > Hi, > Hi, > I have corrected for the dimensions of the ellipse but I cannot achieve > the same effect for the red color. > Thank you. > Fabrice > \startMPcode > def match (expr pos) =3D > fill unitsquare xscaled 4cm yscaled 0.2cm shifted pos withcolor > yellow; > fill origin -- (4cm,0) -- (4.1cm,-0.05cm) -- (0.1cm,-0.05cm) -- cycl= e > 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.50cm yscaled 0.44cm shifted (4.125cm,0.1cm) > withcolor red; > draw fullcircle xscaled 0.50cm yscaled 0.44cm shifted (4.125cm,0.1cm)= ; > draw fullcircle xscaled 0.50cm yscaled 0.44cm shifted (4.125cm,0.1cm) > withshademethod "circular" > withshadevector (0,1) > withshadecolors (red,white) > enddef; > match((0,0)); > > \stopMPcode > > > > Le ven. 14 f=C3=A9vr. 2020 =C3=A0 16:43, Fabrice L a > =C3=A9crit : > >> Hi, >> >> Le 13 f=C3=A9vr. 2020 =C3=A0 16:45, Fabrice Couvreur >> a =C3=A9crit : >> >> >> How to have the color defined by {yellow!60!black} with Metapost ? >> >> >> color MyColor ; MyColor :=3D .6[yellow,black] ; >> >> See metafun manual, section 1.13. >> >> Thank you. >> Fabrice >> >> >> Fabrice (another one !). >> >> >> ________________________________________________________________________= ___________ >> If your question is of interest to others as well, please add an entry t= o >> 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 t= o >> 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 >> >> ________________________________________________________________________= ___________ >> > --000000000000fce033059e9b9d3d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Henri,
Why does the blue path not rotate 90 with the draw command but= rotate with the fill command ?

<= /span>
\startMPcode
=C2=A0
=C2=A0 def ma= tch (expr alpha, pos) =3D
=C2=A0 =C2=A0 fill unitsquare xscaled 4cm =C2= =A0yscaled 0.2cm rotated alpha shifted pos
=C2=A0 =C2=A0 withcolor yello= w ;
=C2=A0 =C2=A0 fill origin -- (4cm,0) -- (4.1cm,-0.05cm) -- =C2=A0(0.= 1cm,-0.05cm) --
=C2=A0 =C2=A0 cycle rotated alpha withcolor(.6yellow + b= lack);
=C2=A0 =C2=A0 draw origin -- (0,0.2cm) -- (4cm,0.2cm) -- (4cm,0) = -- (4.1cm,-0.05cm)
=C2=A0 =C2=A0 -- (0.1cm,-0.05cm) -- cycle rotated alp= ha withcolor blue;
=C2=A0 =C2=A0 =C2=A0draw origin -- (0,0.2cm) -- (4cm,= 0.2cm) -- (4cm,0) -- (4.1cm,-0.05cm)
=C2=A0 =C2=A0 -- (0.1cm,-0.05cm) --= cycle rotated alpha withcolor blue;
=C2=A0 =C2=A0 draw fullcircle xscal= ed 0.50cm yscaled 0.44cm shifted (4.125cm,0.1cm)
=C2=A0 =C2=A0 rotated a= lpha;
=C2=A0 =C2=A0 draw fullcircle xscaled 0.50cm yscaled 0.44cm shifte= d (4.125cm,0.1cm)
=C2=A0 =C2=A0 rotated alpha
=C2=A0 =C2=A0 withshade= method "circular 1"
=C2=A0 =C2=A0 withshadevector (0,1)
=C2= =A0 =C2=A0 withshadecolors (red,white);
=C2=A0 =C2=A0 enddef;
=C2=A0 = match(0,(0,0));
=C2=A0 match(90,(4.2cm,0)); =C2=A0
=C2=A0 match(90,(0= ,0));
=C2=A0 match(0,(0,4.2cm));
=C2=A0
\stopMPcode
<= /div>
=

Le=C2=A0sam. 15 f=C3=A9vr. 2020 =C3=A0=C2=A000:01, Fabrice Couvre= ur <fabrice1.couvreur@gma= il.com> a =C3=A9crit=C2=A0:
Hi,
Hi,<= /span>
I have corrected for the dimensions of the ellip= se but I cannot achieve the same effect for the red color.
Thank you.
Fabrice
\startMPcode
=C2=A0 def match (expr pos) = =3D
=C2=A0 =C2=A0 fill unitsquare xscaled 4cm =C2=A0yscaled 0.2cm shifte= d pos withcolor yellow;
=C2=A0 =C2=A0 fill origin -- (4cm,0) -- (4.1cm,-= 0.05cm) -- =C2=A0(0.1cm,-0.05cm) -- cycle =C2=A0withcolor(.6yellow + black)= ;
=C2=A0 =C2=A0 draw origin -- (0,0.2cm) -- (4cm,0.2cm) -- (4cm,0) -- (4= .1cm,-0.05cm) -- (0.1cm,-0.05cm) -- cycle;
=C2=A0 =C2=A0 fill fullcircle= xscaled 0.50cm yscaled 0.44cm shifted (4.125cm,0.1cm) withcolor red;
= =C2=A0 =C2=A0 draw fullcircle xscaled 0.50cm yscaled 0.44cm shifted (4.125c= m,0.1cm);
=C2=A0 =C2=A0 draw fullcircle xscaled 0.50cm yscaled 0.44cm sh= ifted (4.125cm,0.1cm)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0withshademethod = "circular"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0withshadevector (= 0,1)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0withshadecolors (red,white)
= =C2=A0 enddef;
=C2=A0 match((0,0));
=C2=A0
\stopMPcode

=

Le=C2=A0ven. 14 f=C3=A9vr. 2020 = =C3=A0=C2=A016:43, Fabrice L <fabrice.alpha@gmail.com> a =C3=A9crit=C2=A0:
<= /div>
Hi,
Le 13 f=C3=A9vr. 2020 =C3=A0 16:45, Fabrice= Couvreur <fabrice1.couvreur@gmail.com> a =C3=A9crit :

How to have the color defined by {yellow!60!black} with Metapost ?

color MyColor ; MyColor :=3D .6[= yellow,black] ;

See metafun manual, section 1.13.<= /div>

Thank you.
Fabrice=

Fabrice (another one !).<= br>
___________________________________________________________________________= ________
If your question is of interest to others as well, please add a= n entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/li= stinfo/ntg-context
webpage =C2=A0: http://www.pragma-ade.nl / http://context.aanhet.net
archive = =C2=A0: https://bitbucket.org/phg/context-mirror/commits/
wiki = =C2=A0=C2=A0=C2=A0=C2=A0: http://contextgarden.net
_____________________________________= ______________________________________________
=
_________________________________________________________________= __________________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-cont= ext@ntg.nl / http://www.ntg.nl/mailman/listinfo/nt= g-context
webpage=C2=A0 : http://www.pragma-ade.nl / http://context.aanhet.net=
archive=C2=A0 : https://bitbucket.org/phg/context-m= irror/commits/
wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
___________________________________________________________________________= ________
--000000000000fce033059e9b9d3d-- --===============8305031222881587786== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============8305031222881587786==--