[NTG-context] Problem with a defined colour in MetaFun

Wolfgang Schuster wolfgang.schuster.lists at gmail.com
Thu Apr 28 17:04:23 CEST 2022

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.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20220428/0e65f065/attachment.htm>

More information about the ntg-context mailing list