From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI autolearn=no autolearn_force=no version=3.4.4 Received: from cgl.ntg.nl (Cgl.ntg.nl [5.39.185.202]) by inbox.vuxu.org (Postfix) with ESMTP id 824662213D for ; Tue, 9 Apr 2024 14:58:09 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 594EC483F7D for ; Tue, 9 Apr 2024 14:54:30 +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 LUZD56TeF_ls for ; Tue, 9 Apr 2024 14:54:30 +0200 (CEST) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 5AE02484397 for ; Tue, 9 Apr 2024 14:54:09 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id D53B7483F73 for ; Tue, 9 Apr 2024 14:53:42 +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 JcxEzbb3BzeQ for ; Tue, 9 Apr 2024 14:53:42 +0200 (CEST) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id AB83E483F6C for ; Tue, 9 Apr 2024 14:53:42 +0200 (CEST) MIME-Version: 1.0 From: seyal.zavira@gmail.com To: ntg-context@ntg.nl Date: Tue, 09 Apr 2024 12:53:42 -0000 Message-ID: <171266722269.3369327.8131443943302856031@cgl.ntg.nl> User-Agent: HyperKitty on http://mailman.ntg.nl/ Message-ID-Hash: 245TL5AUBXF6GJUG765BLNGZXMW3ELNU X-Message-ID-Hash: 245TL5AUBXF6GJUG765BLNGZXMW3ELNU X-MailFrom: seyal.zavira@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] how to apply metapost effects to section title? List-Id: mailing list for ConTeXt users Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit i want to produce a gradient header i tried this code but it does not produce any result: \startext \def\Mystyle#1{\startMPcode picture tt ; tt := lmt_outline [ kind = "path", text = "#1", ] ; fill for i within tt : pathpart i && endfor cycle withshademethod "linear" withshadedirection up withshadecolors (red, blue) ; \stopMPcode } \definehead[Myhead][section] \setuphead[Myhead][ style=\Mystyle, ] \startMyhead[title=sample] a sample text \stopMyhead \stoptext and the code below works but does not colorize numbers of this heads: \starttext \def\Mystyle#1{\startMPcode picture tt ; tt := lmt_outline [ kind = "path", text = "#1", ] ; fill for i within tt : pathpart i && endfor cycle withshademethod "linear" withshadedirection up withshadecolors (red, blue) ; \stopMPcode } \def\startMysection#1{\startsection[title=\Mystyle{#1}]} \def\stopMysection{\stopsection} \startMysection{hello} what is best method? \stopMysection \stoptext what is your suggestion? ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___________________________________________________________________________________