[geeks] Postscript question
Greg A. Woods
woods at weird.com
Tue Nov 19 14:56:03 CST 2002
[ On Tuesday, November 19, 2002 at 15:43:54 (-0500), Joshua D Boyd wrote: ]
> Subject: [geeks] Postscript question
>
> 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?
How do you define "corner"?
In PostScript a corner is just a point (in the true geometry sense). It
can't have a colour (though of course a single pixel will overlay a
point and so that one pixel could have a colour). Only the lines
joining points, or the areas between sets of points, can have colours.
--
Greg A. Woods
+1 416 218-0098; <g.a.woods at ieee.org>; <woods at robohack.ca>
Planix, Inc. <woods at planix.com>; VE3TCP; Secrets of the Weird <woods at weird.com>
More information about the geeks
mailing list