From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 9761 invoked from network); 7 Oct 2023 16:31:49 -0000 Received: from cgl.ntg.nl (5.39.185.202) by inbox.vuxu.org with ESMTPUTF8; 7 Oct 2023 16:31:49 -0000 Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 593724831B1 for ; Sat, 7 Oct 2023 18:31:48 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZMQeqijQCeSb for ; Sat, 7 Oct 2023 18:31:47 +0200 (CEST) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id C7712483398 for ; Sat, 7 Oct 2023 18:30:05 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id A772D48317E for ; Sat, 7 Oct 2023 18:29:48 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id odI7pcnjfc5g for ; Sat, 7 Oct 2023 18:29:48 +0200 (CEST) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cgl.ntg.nl (Postfix) with ESMTPS id 2A02848317C for ; Sat, 7 Oct 2023 18:29:48 +0200 (CEST) Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-3247d69ed2cso3035252f8f.0 for ; Sat, 07 Oct 2023 09:29:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696696187; x=1697300987; darn=ntg.nl; h=in-reply-to:from:references:to:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=jPwjrBxnvQnV2yXiacl0qjxkIcwMvUi1kYL7NHi3Ilo=; b=cSeYTqfoDM+rV5rKYXA73rlg9qqGsHCx/8TWsppVEtUe7C/6wvnRpol3En+t8XtxXa krYBV0Bmmv0Q44pZPSiAsFrKF5PRqTvQpy4soKBomJTj86e3BI0nh4CFV8LEw3myFocX gsrMdkJB/v8U6QobpBzezNwKbRYZb4jPeyVulS9KR20Tms3TKFVwakXELz1hrRncgR6t zGshes5lp0h8Fzw+svWq/iHbchbGiJUE3u+wIK0c1WZABhYiw4UzbVoaH4rpHk3slm3Z j0KtncX19Gbo7MJtdOO5DVZNB2eNFS/rtVvptEa7OoKf+d0bPJX78jSq4YOhellk3wBT 5h2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696696187; x=1697300987; h=in-reply-to:from:references:to:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jPwjrBxnvQnV2yXiacl0qjxkIcwMvUi1kYL7NHi3Ilo=; b=kNpDCKPrPoFXr1Fu2tIMejYp41zGhqkE6Ty0Zf02aZO0ja/LVr+mJq3zw0DQXYUsr7 GH4sQYfRlhey5kcf5tKkDkK/gyff8+qrPHV410lG/AUh6FItSnmZHu7B0UGaS7Qjx8ni FtRGUjAK5h9dsSMSUQW4D0SeCkm70V5icRzlRbkWSH5MiBwrt/MXbFr6Fnva4Rx4+lG1 69cYiHWoZLi0u4FUSBYhPa2EAPOiSjjF96HAM4x1yjPHkcRn7rVCiEyH/IXa15hk8d2D jcUum6ur/DiEr4rNtY1NS49Rs4HRRgAlMb19XwpaJGCRBCho83Wdc77VQIZd3oUS7DVL DrPA== X-Gm-Message-State: AOJu0YxFjKN0c0s2Bvqd+GKkHnCg73dygvmKPUxXJvLqsaexkRmnV3GU 4d1ZRDgPJbQWnDZBb/2UyK6205N0bjxcOg== X-Google-Smtp-Source: AGHT+IH61PgqEmv5iDt3fboAWZEE47wTEL12t62XGmZEgEfhvb7nIfLVNYq6NbHOKaC+t8tE8R+cJA== X-Received: by 2002:a5d:5187:0:b0:31f:ec06:20f with SMTP id k7-20020a5d5187000000b0031fec06020fmr9704882wrv.14.1696696186678; Sat, 07 Oct 2023 09:29:46 -0700 (PDT) Received: from ?IPV6:2a00:23c6:7796:5f01:5c91:7a2b:7e53:864b? ([2a00:23c6:7796:5f01:5c91:7a2b:7e53:864b]) by smtp.gmail.com with ESMTPSA id c6-20020adfed86000000b003279518f51dsm4668417wro.2.2023.10.07.09.29.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 07 Oct 2023 09:29:45 -0700 (PDT) Message-ID: <6eeda8ef-3ad2-07a8-4a51-de2ba79fadff@gmail.com> Date: Sat, 7 Oct 2023 17:29:44 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 To: mailing list for ConTeXt users , Fabrice Couvreur References: <717858b0-a34e-4525-7e17-f6b86187e1c7@fiee.net> <0ab0cdb4-adf7-9552-d2a0-019275259cc1@fiee.net> From: Keith McKay In-Reply-To: Message-ID-Hash: OPMICJ5JWXTVO3W344N4GPTCA52IJWON X-Message-ID-Hash: OPMICJ5JWXTVO3W344N4GPTCA52IJWON X-MailFrom: mckaymeister@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list Reply-To: mailing list for ConTeXt users Subject: [NTG-context] Re: Gray gradient with Metapost List-Id: mailing list for ConTeXt users Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: multipart/mixed; boundary="===============3733114391291766437==" This is a multi-part message in MIME format. --===============3733114391291766437== Content-Type: multipart/alternative; boundary="------------4wyOGylp3qIgUQjnyYvPbBMu" This is a multi-part message in MIME format. --------------4wyOGylp3qIgUQjnyYvPbBMu Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi Fabrice, You could define you own shades of gray (I believe there are at least 50) by adjusting the rgb values as I've shown below. definecolor [ name = "verylightgray", r = 0.995, g = 0.995, b = 0.995 ] ; definecolor [ name = "lightergray", r = 0.55, g = 0.55, b = 0.55 ] ; draw lmt_shade [ path = (z0--z4--z5--z1--cycle), direction = "left", alternative = "linear", colors = {"lightergray", "verylightgray"}, ] xshifted 5cm; I added it to your code after the lines: draw z0--z4--z3--cycle; draw z1--z5--z2--cycle; draw rectangle; Hope this helps. Best Wishes Keith On 07/10/2023 16:54, Fabrice Couvreur wrote: > Hi, > Sorry for the late response. Thanks for the help. So I read the > documents and managed to get a gradient even if it's not exactly like > the figure. > Fabrice > > draw lmt_shade [ >               path = (z0--z4--z5--z1--cycle), >               direction = "left", >               alternative = "linear", >               colors = {"black", "lightgray"}, >             ] ; > > Le ven. 6 oct. 2023 à 08:27, Henning Hraban Ramm a > écrit : > > While the luametafun (“Metafun XL”) manual is also (meta)fun, I meant > the general metafun(-s|-p) manual, the big one (>400 p. in the > “print” > version, >600 p. in the “screen” version). Recommended! > > Hraban > > Am 06.10.23 um 10:08 schrieb Keith McKay: > > Also look at the LuaMetaFun manual chapter 8. In fact the whole > manual > > is worth a read. I'm sure you find much of use in it. > > Best Wishes > > Keith > > > > On Thu, 5 Oct 2023, 20:52 Henning Hraban Ramm, > > wrote: > > > >     Am 05.10.23 um 21:50 schrieb Fabrice Couvreur: > >      > Hi, > >      > I would like to obtain, if possible, a gray gradient like > in the > >     image. > >      > My code uses Metapost but maybe this is possible with > Metafun. > > > >     Have a look into the Metafun manual, chapter 8.1 “shading”. > > > >     Hraban > > ___________________________________________________________________________________ > If your question is of interest to others as well, please add an > entry to the Wiki! > > maillist : {listname} / > https://mailman.ntg.nl/mailman3/lists/{list_id} > > webpage  : https://www.pragma-ade.nl / https://context.aanhet.net > (mirror) > archive  : https://github.com/contextgarden/context > wiki     : https://wiki.contextgarden.net > ___________________________________________________________________________________ > > > ___________________________________________________________________________________ > If your question is of interest to others as well, please add an entry to the Wiki! > > maillist : {listname} /https://mailman.ntg.nl/mailman3/lists/{list_id} > webpage :https://www.pragma-ade.nl /https://context.aanhet.net (mirror) > archive :https://github.com/contextgarden/context > wiki :https://wiki.contextgarden.net > ___________________________________________________________________________________ --------------4wyOGylp3qIgUQjnyYvPbBMu Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Hi Fabrice,

You could define you own shades of gray (I believe there are at least 50) by adjusting the rgb values as I've shown below.

definecolor [ name = "verylightgray", r = 0.995, g = 0.995, b = 0.995 ] ;

definecolor [ name = "lightergray", r = 0.55, g = 0.55, b = 0.55 ] ;

draw lmt_shade [

path = (z0--z4--z5--z1--cycle),

direction = "left",

alternative = "linear",

colors = {"lightergray", "verylightgray"},

] xshifted 5cm;

I added it to your code after the lines:

draw z0--z4--z3--cycle;

draw z1--z5--z2--cycle;

draw rectangle;

Hope this helps.

Best Wishes

Keith

On 07/10/2023 16:54, Fabrice Couvreur wrote:
Hi,
Sorry for the late response. Thanks for the help. So I read the documents and managed to get a gradient even if it's not exactly like the figure.
Fabrice

draw lmt_shade [
              path = (z0--z4--z5--z1--cycle),
              direction = "left",
              alternative = "linear",
              colors = {"black", "lightgray"},
            ] ;

Le ven. 6 oct. 2023 à 08:27, Henning Hraban Ramm <texml@fiee.net> a écrit :
While the luametafun (“Metafun XL”) manual is also (meta)fun, I meant
the general metafun(-s|-p) manual, the big one (>400 p. in the “print”
version, >600 p. in the “screen” version). Recommended!

Hraban

Am 06.10.23 um 10:08 schrieb Keith McKay:
> Also look at the LuaMetaFun manual chapter 8. In fact the whole manual
> is worth a read. I'm sure you find much of use in it.
> Best Wishes
> Keith
>
> On Thu, 5 Oct 2023, 20:52 Henning Hraban Ramm, <texml@fiee.net
> <mailto:texml@fiee.net>> wrote:
>
>     Am 05.10.23 um 21:50 schrieb Fabrice Couvreur:
>      > Hi,
>      > I would like to obtain, if possible, a gray gradient like in the
>     image.
>      > My code uses Metapost but maybe this is possible with Metafun.
>
>     Have a look into the Metafun manual, chapter 8.1 “shading”.
>
>     Hraban

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : {listname} / https://mailman.ntg.nl/mailman3/lists/{list_id}
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : {listname} / https://mailman.ntg.nl/mailman3/lists/{list_id}
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context 
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________
--------------4wyOGylp3qIgUQjnyYvPbBMu-- --===============3733114391291766437== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : {listname} / https://mailman.ntg.nl/mailman3/lists/{list_id} webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___________________________________________________________________________________ --===============3733114391291766437==--