% Chapter 3. Embedded graphics
%
% 3.5 Communicating color
\setupcolors [state=start]
\setupinteraction [state=start]

\starttext

  \definecolor[cmyyellow][y=1]
  \definecolor[rgbyellow][r=1,g=1]

  \definecolor[cmydarkyellow][y=.625] 
  \definecolor[rgbdarkyellow][r=.625,g=.625]

  \startuseMPgraphic{All kinds of yellow}
    pickup pencircle scaled 1mm ;
    path p ; p := unitsquare xscaled 3cm yscaled 1cm ;
    fill p shifted (0cm,0cm) withcolor yellow ;
    fill p shifted (4cm,0cm) withcolor (1,1,0) ;
    fill p shifted (8cm,0cm) withcolor (.5,.5,0) ;
    fill p shifted (0cm,-1.5cm) withcolor \MPcolor{rgbyellow} ;
    fill p shifted (4cm,-1.5cm) withcolor \MPcolor{rgbdarkyellow} ;
    fill p shifted (8cm,-1.5cm) withcolor .5\MPcolor{rgbyellow} ;
    fill p shifted (0cm,-3cm) withcolor \MPcolor{cmyyellow} ;
    fill p shifted (4cm,-3cm) withcolor \MPcolor{cmydarkyellow} ;
    fill p shifted (8cm,-3cm) withcolor .5\MPcolor{cmyyellow} ; % do not work correctly!
  \stopuseMPgraphic

  \useMPgraphic{All kinds of yellow}

\stoptext

