Chapter Contents

Previous

Next
RGBDM

RGBDM



Returns the name supported by the SAS windowing environment for a color

Category: Utility


Syntax
Details
Example

Syntax

DM-color-name=RGBDM(color-name<,RGB-color>);

DM-color-name
contains the name of the SAS windowing environment color that is closest to color-name.

Type: Character

color-name
is a color name to look up: BLACK, BLUE, BROWN, CYAN, GRAY, GREEN, MAGENTA, ORANGE, PINK, RED, WHITE, or YELLOW. Any SAS/GRAPH color name is allowed, as well as SASCOLOR window elements. Arbitrary RGB colors can be specified using the CXrrggbb convention.

Type: Character

RGB-color
returns color-name in the CXrrggbb format.

Note:   This parameter is an update parameter. See Input, Output, and Update Parameters for more information.  [cautionend]

Type: Character


Details

The RGBDM function provides a way to determine both the closest color that is supported by the SAS windowing environment for a specified color and the RGB values for a color name. If color-name is a variable and the specified color is a valid color abbreviation, the variable is updated with the complete color name. For example, the color "R" would be translated to "RED" and the RGB-color would be "CXFF0000". The value for RGB-color may be different depending on the host operating system.

For more information about the CXrrggbb format, see SAS/GRAPH Software: Reference.


Example

Display the color components of several different colors:

length rgbclr $ 8;
INIT:
      /* display txtclr=red */
      /* rgbclr=cxff0000    */
   txtclr = rgbdm("RED", rgbclr);
   put txtclr= rgbclr=;

      /* display txtclr=red */
   txtclr = rgbdm("cxf00000");
   put txtclr=;

      /* display txtclr=red clr=red */
   clr='r';
   txtclr = rgbdm(clr);
   put txtclr= clr= ;

      /* display the foreground */
      /* color in rgb values    */
   txtclr = rgbdm("FOREGROUND", rgbclr);
   put txtclr= rgbclr=;
return;
In some operating environments, this example produces the following output:
txtclr=RED rgbclr=CXFF0000
txtclr=RED
txtclr=RED clr=RED
txtclr=WHITE rgbclr=CXF2F2F2


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.