From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/114805 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Wolfgang Schuster via ntg-context Newsgroups: gmane.comp.tex.context Subject: Re: Problem with a defined colour in MetaFun Date: Thu, 28 Apr 2022 17:04:23 +0200 Message-ID: <53af5dbe-fabd-6dc8-8dc7-8b86e44d8ba5@gmail.com> References: <3fc7c602-d9de-6b68-e771-240eebee4cb8@gmail.com> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4308051749082290972==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="651"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 PostboxApp/7.0.56 Cc: Wolfgang Schuster , Keith McKay To: mailing list for ConTeXt users , Keith McKay via ntg-context Original-X-From: ntg-context-bounces@ntg.nl Thu Apr 28 17:04:57 2022 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 1nk5hQ-000AUv-Vv for gctc-ntg-context-518@m.gmane-mx.org; Thu, 28 Apr 2022 17:04:57 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 4CC062A37B7; Thu, 28 Apr 2022 17:04:34 +0200 (CEST) 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 zT96IV-AUBhi; Thu, 28 Apr 2022 17:04:32 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id E486B2A37DA; Thu, 28 Apr 2022 17:04:31 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 6ED052A37B7 for ; Thu, 28 Apr 2022 17:04:30 +0200 (CEST) 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 DO6Hwn0PCS_J for ; Thu, 28 Apr 2022 17:04:29 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.218.50; helo=mail-ej1-f50.google.com; envelope-from=wolfgang.schuster.lists@gmail.com; receiver= Original-Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (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 76FFC2A37B2 for ; Thu, 28 Apr 2022 17:04:29 +0200 (CEST) Original-Received: by mail-ej1-f50.google.com with SMTP id k23so10170779ejd.3 for ; Thu, 28 Apr 2022 08:04:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=C3Y7RAQV9iS7WWOb4g9yzxrZci+rARrv0A+oERZhTig=; b=Hyo5YVK/yyTxQHGBdHzc0JoxsvCxvf3MbMI9EoeoSeeQxxjxyt5mhYeGXt/PQrs7M8 cdYEwb5gT+ksm8XArQLzDEAT1Sm5J2K7riXT6M11caUBjPCZ05EckB3fVGtYi2eu3UbS 3rs+1yT4ceE/BAJ0E9agQ8jv2hYXuDXqZ5e5Uk03TBNlya0pSs3wXUx1Ep7qBOCiFXNo Y6NVaDGBowczftsaWwApKpz0bF6X7gb6jmzWvYUYg6BPWpQMY2fu2Jwjj03SeUDy+QIY DnmnfadeA+wplMm7FObzFWBNpYu1XYbKAsPLhT/Sqm1rvZh1cLnS+EvSGRf3HzTpzNXe jcFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=C3Y7RAQV9iS7WWOb4g9yzxrZci+rARrv0A+oERZhTig=; b=EuMm/vJYCwLOIi53Cd7zVA7B+T/tpqxFrb/lpB5hZUqaZnUh6WDo63hNqBuDUQNIGM Y3VmrWkSK8+3BzDGjNa13ql2g7R5PtYGKjz+TiNjEGS/1Lk0y3LwXV+sj64ceR/p39/d V2UqThtD3hnBvzZWvZXbMhZF+uSq02QCQZSAiC+Uhm0oNsYs+1BmP6Afb4gri2RtK06f 7C9UQmaDJqJPxStG2ruFt/ESLKWQfJ7Wci+0xNv9WIhJRg0g4Z9SVGluxhVyfPbYXNI0 ar91ny5BEp4I41BT8HF93hMq5TWkI8xhGfhy+Vyx5Xio/SLhiDQcjcB7nZOZ7a7uvEnZ fHqA== X-Gm-Message-State: AOAM532DGPwT6KNgT5dOCnos6/ju0JSYsqU29Fb5BOPytqnFC5It9RlN ycI6RlG0y7X+hGCGnu6yZLk= X-Google-Smtp-Source: ABdhPJxB8J5jTh7NpBmcddKcMrtgcWY8WNdT4hdNMso5gSphXzaf0yGUK2kJzbA7F8FviF14WzMksA== X-Received: by 2002:a17:907:9506:b0:6da:b4cd:515b with SMTP id ew6-20020a170907950600b006dab4cd515bmr32162800ejc.602.1651158264684; Thu, 28 Apr 2022 08:04:24 -0700 (PDT) Original-Received: from ?IPv6:2a02:810d:a8bf:f874:159b:9bda:d15e:8447? ([2a02:810d:a8bf:f874:159b:9bda:d15e:8447]) by smtp.gmail.com with ESMTPSA id ej4-20020a056402368400b0042617ba637dsm1711732edb.7.2022.04.28.08.04.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Apr 2022 08:04:23 -0700 (PDT) In-Reply-To: <3fc7c602-d9de-6b68-e771-240eebee4cb8@gmail.com> Content-Language: en-US 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:114805 Archived-At: This is a multi-part message in MIME format. --===============4308051749082290972== Content-Type: multipart/alternative; boundary="------------DE191A5ACDE25E32988001B1" Content-Language: en-US This is a multi-part message in MIME format. --------------DE191A5ACDE25E32988001B1 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Keith McKay via ntg-context schrieb am 28.04.2022 um 12:05: > > Hi, > > In the MWE below I define an rgb colour, myColor1, using random > numbers for the r, g and b components. I then use it to fill a > unitsquare the size of the page, which works as expected. In the loop > that follows I then use the defined colour, myColor1, along with white > and the variable r to create shades of myColor1 as in the MWE below. > However, myColor1 is not recognised in the loop and seems to be > replaced by black, although if I use a predefined colour, in this case > BurntSienna from the crayola collection, it works as expected.  I have > tried a number of ways to get this to work as shown in the code but > without success. I would be grateful for any suggestions. > > Best Wishes > > Keith McKay > > %%%%%%%%%%%%%%%%%%%%MWE%%%%%%%%%%%%% > > \setuppapersize[A4,portrait] > > \usecolors[crayola] > > \starttext > > \dorecurse{10}{ > > \startMPpage > > StartPage; > > \definecolor[name="myColor1", r = uniformdeviate(1), g = > uniformdeviate(1), b = uniformdeviate(1) ] ; > Remove the backslash in front of the definecolor command. Wolfgang --------------DE191A5ACDE25E32988001B1 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit Keith McKay via ntg-context schrieb am 28.04.2022 um 12:05:

Hi,

In the MWE below I define an rgb colour, myColor1, using random numbers for the r, g and b components. I then use it to fill a unitsquare the size of the page, which works as expected. In the loop that follows I then use the defined colour, myColor1, along with white and the variable r to create shades of myColor1 as in the MWE below. However, myColor1 is not recognised in the loop and seems to be replaced by black, although if I use a predefined colour, in this case BurntSienna from the crayola collection, it works as expected.  I have tried a number of ways to get this to work as shown in the code but without success. I would be grateful for any suggestions.

Best Wishes

Keith McKay

%%%%%%%%%%%%%%%%%%%%MWE%%%%%%%%%%%%%

\setuppapersize[A4,portrait]

\usecolors[crayola]

\starttext

\dorecurse{10}{

\startMPpage

StartPage;

\definecolor[name="myColor1", r = uniformdeviate(1), g = uniformdeviate(1), b = uniformdeviate(1) ] ;


Remove the backslash in front of the definecolor command.

Wolfgang

--------------DE191A5ACDE25E32988001B1-- --===============4308051749082290972== 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== --===============4308051749082290972==--