Hi, 

It seems to work when defining a color as described in https://wiki.contextgarden.net/Color_in_MetaPost , if that's an option:
________________________________________________
\startMPcode
color MyColor ;
MyColor = (.5, .25, .25) ;
fill fullsquare xyscaled (40mm, 15mm) withcolor MyColor ;
fill fullsquare xyscaled (40mm, 15mm) shifted (42mm, 0mm) withcolor 0.5MyColor ;
\stopMPcode
________________________________________________

Otherwise the solution proposed by Hans is probably better. (And may well be better anyway!)

Cheers,
Florent

Le mer. 1 janv. 2025 à 21:05, vm via ntg-context <ntg-context@ntg.nl> a écrit :
with the environment of

\startMPcode
you can scale a color with a factor like
0.25red and 0.5blue

But this not seem to work when you define a color yourself first

definecolor [ name = "MyColor", r = .5, g = .25, b = .25 ] ;
fill fullsquare xyscaled (40mm, 15mm) withcolor "MyColor" ;

fill fullsquare xyscaled (40mm, 15mm) shifted (42mm, 0mm) withcolor
0.5"MyColor" ;



What would be the correct way to scale self defined colors?

.F

___________________________________________________________________________________
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
___________________________________________________________________________________