Colors.mp
u:=25; % 25 = 25bp = 25 PostScript points = 30/72 in
wi:=10; % width in units u
he:=10; % height in units u
hoehe:=he*u; % height
breite:=wi*u; % width
pair P[], xy[];
path p[];
transform t;
color c[];
n:=20; rd:=0.2; b:=(wi-2rd)/4;
P0:=(0, 0);
t:=identity scaled u shifted P0;
beginfig(1)
fill (0, 0)--(breite, 0)--(breite, hoehe)--(0, hoehe)--cycle withcolor .9white;
draw (0, 0)--(breite, 0)--(breite, hoehe)--(0, hoehe)--cycle;
for k=0 upto 3:
blau:=.3333k;
P1:=(rd, he-rd-b)+k*b*(1, -1);
for i=0 upto n-1:
for j=0 upto n-1:
xy0:=P1+(i*b/n, j*b/n);
p0:=xy0--(xy0+(b/n, 0))--(xy0+(b/n, b/n))--(xy0+(0, b/n))--cycle;
c0:=((i+1)/n, (j+1)/n, blau);
fill p0 transformed t withcolor c0;
endfor
endfor
draw (P1--(P1+(b, 0))--(P1+(b, b))--(P1+(0,b))--cycle) transformed t;
P2:=(P1+(0, b))transformed t;
label.lrt("bluepart c", P2);
label.lrt("="&decimal blau, P2+(0, -3mm));
label.urt("latex2html version 2002 - 1", (0,0));
endfor
endfig;
end