Sun Microsystems 800-1256-04 — Sun Microsystems 800-1256-04 SunCGI Reference Manual PDF

Chapter 4 -Attributes 63 Q Fill Color Cerror fill_color(color) Cint color; /* color for solid object fill*/ fill_ color determines the color for filling solid objects, if the fill style is not set to HOLLOW. The default fill style is HOLLOW, so changing the fill color will not have an effect without changing the interior style first. The default fill color is 1. An error is detected if fill color is not between O and 255. Errors ENOTOPOP [5] CGI not in proper state CGI shall be in state VDOP, VSOP, or VSAC. ECINDXLZ [35] Color index is less than zero. EBADCOLX [36] Color index is invalid. 4.6.

Hatch and Pattern Attributes Geometrical primitives can be filled with 2D arrays of color values called pat- terns. SunCGI supports pre-defined as well as user-defined patterns. The definition of patterns is stored in the pattern table. Each entry in the pattern table consists of a 2D array of color values and the x and y dimensions of the array. The starting position (upper left-hand comer) of the pattern is determined by the pattern reference point. 0 Two types of patterns are available: PA1TERNs and HATCHes. PATTERNS can be scaled and translated. HATCHes can't and simply fill the geometrical output primitives with pixel arrays.

The following example program illustrates how to change the appearance with the individual attribute functions. The program draws a polygon and fills it with a pattern. 0 Version C of 17 March 1986