% --- start of displayed preamble in the book ---
input hatching;
% star macro defined as above
% --- end of displayed preamble in the book ---

% graphic converted to gray in book using 'color2gray'

vardef star(expr n) =
for i_:=0 upto 2n-1:
 if odd i_: 1/2 fi (right rotated (180*(i_/n))) --
endfor cycle
enddef;

defaultfont:="ptmr8r";
warningcheck:=0;
beginfig(1)
path p;
p:=star(10) xscaled 30mm
           yscaled 20mm
           rotated 20;
interim hatch_match:=0;
hatchoptions(withcolor blue
            dashed evenly scaled 2);
hatchfill p withcolor .75white
           withcolor (20,6bp,-.5bp);
hatchoptions(withcolor (blue+green)
            dashed evenly
            shifted (3/2bp,0));
hatchfill p withcolor (110,6bp,-.5bp);
endfig;
end;