[geeks] Postscript question

Joshua D Boyd jdboyd at cs.millersville.edu
Tue Nov 19 14:43:54 CST 2002


I have one quick question about how to do something in poscript.

/inch {72 mul} def      % Convert inches->points (1/72 inch)
1 0 0 setrgbcolor
newpath                 % Start a new path
1 inch 1 inch moveto    % an inch in from the lower left
2 inch 1 inch lineto    % bottom side
2 inch 2 inch lineto    % right side
1 inch 2 inch lineto    % top side
closepath               % Automatically add left side to close path
fill                    % Fill in the box on the paper
showpage                % We're done... eject the page

So, this code makes is easy for drawing a red square.

The question is, what if I want to draw a box where the corners are 4
different shades.  Say a box with a red corner, a blue corner, a green
corner, and a black corner.  How in the world would I pull that off?

-- 
Joshua D. Boyd



More information about the geeks mailing list