color Function (For GPL Graphic Elements)

Note: If you are modifying the color for a guide, refer to color Function (For GPL Guides) .

Syntax

color(<algebra>)

or

color(color.<color constant>)

or

color(color."color value")

or

color(<statistic function>)

<algebra>. Graph algebra, using one variable or a blend of variables. Each unique variable value results in a different color. For example, if you were creating a stacked bar chart, the argument of the color function would be the variable that controls the stacking. Each stack segment would be a different color.

<color constant>. A constant indicating a specific color, such as red. See the topic Color Constants (GPL) for more information. Color constants can also be blended (for example, color.blue+color.red).

"color value". A specific value that indicates the hexadecimal RGB color components (for example, color."6666FF").

<statistic function>. A statistic function.

Description

Controls the color of the graphic elements. To specify the color explicitly for the fill or border of the graphic element, you can append .interior or .exterior to the function. Using color without a qualifier implies color.interior.

Examples

Figure 1. Example: Specifying a color value with a constant
ELEMENT: line(position(x*y), color(color.red))
Figure 2. Example: Specifying a color value with RGB color components
ELEMENT: line(position(x*y), color(color."FF0000"))
Figure 3. Example: Specifying a color value for the bar border
ELEMENT: interval(position(x*y), color.exterior(color.red))
Figure 4. Example: Using the values of a variable to control color
ELEMENT: point(position(x*y), color(z))
Figure 5. Example: Using a statistical function to control color
ELEMENT: interval(position(summary.mean(jobcat*salary)), 
         color(summary.count()))

Statistic Functions

See GPL Functions .