•
|
Fill Color() for solid areas
|
•
|
Level Color() for categorical data
|
•
|
Pen Color() for lines and points
|
•
|
Back Color() for the background of text (similar to the box around the erased text in Drawing Text in a Graph Box)
|
•
|
Background Color() for the graph’s background color
|
•
|
Font Color() for added text
|
Fill colors overwrite pen colors for drawn shapes. You do not get both, as in some drawing packages. To get both a fill and a pen line, draw two shapes, one with fill and one without. You can select a color with a single numeric argument, a color name in quotation marks, or an RGB value. The standard colors are specified with numbers 0–15 (both 0 and 15 are black) or by their names (Standard JMP Colors).
colors = {"Black", "Gray", "White", "Red", "Green", "Blue", "Orange", "BlueGreen", "Purple", "Yellow", "Cyan", "Magenta", "YellowGreen", "BlueCyan", "Fuchsia"};
ymax = 15;
win = New Window( "The JMP Colors",
Graph Box(
Frame Size( 300, 300 ),
X Scale( 0, ymax ),
Y Scale( 0, ymax + 2 ),
For( i = 0, i < ymax, i++,
If( colors[i + 1] == "White",
Fill Color( 65 );
Rect( 0, i + 1 + .5, 15, i + 1 - .5, 1 );
);
Pen Color( colors[i + 1] );
Text Color( colors[i + 1] );
H Line( i + 1 );
Text( {2, i + 1}, i );
Text( {5, i + 1}, colors[i + 1] );
)
)
);
Larger numbers cycle through shading variations of the same color sequence. A script demonstrating this appears under Colors and Markers. Values outside the range 0–84 are not accepted.
Pen Color( {.38,.84,.67} ); // teal
RGB Color() and Color to RGB() convert color values between JMP color numbers and the red-green-blue system. The following example finds the RGB values for JMP color 3 (red):
Color to RGB( 3 );
{0.941176470588235, 0.196078431372549, 0.274509803921569}
Likewise, HLS Color() and Color to HLS() convert color values between JMP color numbers and the hue-lightness-saturation system.
win = New Window( "Color Wheel",
Graph(
Frame Size( 200, 200 ),
For( hue = 0, hue < 360, hue += 30,
y = 50 - 40 * Cos( hue * 2 * Pi() / 360 );
x = 50 + 40 * Sin( hue * 2 * Pi() / 360 );
Fill Color( HLS Color( hue / 360, 0.5, 1 ) );
Oval( x - 10, y - 10, x + 10, y + 10, 1 );
)
)
);
Finally, Heat Color() returns the JMP color that corresponds to a value in any color theme that is supported by Cell Plot, Treemap, and so on. The syntax is:
Heat Color( n, <<"theme" )
The theme message is optional, and the default value is "Blue to Gray to Red". You can specify any color theme, including custom color themes. You can also create and use an anonymous color theme as shown in the following examples:
Heat Color( z, <<{"", {{1, 1, 0}, {0, 0, 1}} } );
Heat Color( z, <<{"", {blue, green, yellow} } );