Usage Note 48480: Download the %COLORSCALE macro
The %COLORSCALE macro can be used to determine a list of colors in a gradient. This macro is referenced in several SAS/GRAPH® papers.
The macro code can be downloaded from the Downloads tab. Usage information is included below and can also be found in the comment sections of the macro code.
The TOP and BOTTOM colors of the color gradient are required; a middle color is optional. The value N sets the desired number of intermediate colors. For example, if N is 10 and no middle color is specified, 12 colors are shown in the output. If a middle color is specified, 13 colors are shown in the output.
The macro takes the following parameters:
TOP: color displayed on top of the output
MIDDLE: optional middle color; the gradient is forced through this color
BOTTOM: color displayed on the bottom of the output
N: the number of intermediate colors
ANNO: name of the annotate data set used to display the color scale
Colors should be represented as RGB hexadecimal values, such as FFFFFF for white or 000000 for black.
This macro uses the INCR macro to calculate the intermediate color values.
Because values must be rounded, slightly different results might occur if the values for the top and bottom colors are reversed. If the last intermediate color seems to 'jump' from the top or bottom color, try reversing the values for the top and bottom colors.
When you invoke the macro, remember that the parameters are positional. If no middle color is specified, the comma should remain. For example:
%colorscale(000000,,FFFFFF,3,anno);
Operating System and Release Information
SAS System | SAS/GRAPH | z/OS | 9.1 TS1M3 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.1 TS1M3 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.1 TS1M3 | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.1 TS1M3 | |
Microsoft Windows XP 64-bit Edition | 9.1 TS1M3 | |
Microsoft Windows 2000 Advanced Server | 9.1 TS1M3 | |
Microsoft Windows 2000 Datacenter Server | 9.1 TS1M3 | |
Microsoft Windows 2000 Server | 9.1 TS1M3 | |
Microsoft Windows 2000 Professional | 9.1 TS1M3 | |
Microsoft Windows NT Workstation | 9.1 TS1M3 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M3 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M3 | |
Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M3 | |
Microsoft Windows XP Professional | 9.1 TS1M3 | |
Windows Vista | 9.1 TS1M3 | |
Windows Vista for x64 | 9.1 TS1M3 | |
64-bit Enabled AIX | 9.1 TS1M3 | |
64-bit Enabled HP-UX | 9.1 TS1M3 | |
64-bit Enabled Solaris | 9.1 TS1M3 | |
HP-UX IPF | 9.1 TS1M3 | |
Linux | 9.1 TS1M3 | |
OpenVMS Alpha | 9.1 TS1M3 | |
Tru64 UNIX | 9.1 TS1M3 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
Date Modified: | 2012-12-19 12:37:09 |
Date Created: | 2012-11-15 13:30:33 |