RGB Function (VisioShapeSheet)

Returns a value representing an index in the document's color palette. It specifies a color by its red, green, and blue components, where each is a number in the range 0 to 255, inclusive, or an expression that evaluates to such a number.

Syntax

RGB(red, green*,blue )

Parameters

Name Required/Optional Data Type Description
red
Required
Number
The red component.
green
Required
Number
The green component.
blue
Required
Nmber
The blue component.

Return value

Number

Remarks

If the color returned by the function does not already exist in the current document's color palette, it is added to the palette.

The following table lists some standard colors and their red, green, and blue values.

Color Red value Green value Blue value
Black
0
0
0
Blue
0
0
255
Green
0
255
0
Cyan
0
255
255
Red
255
0
0
Magenta
255
0
255
Yellow
255
255
0
White
255
255
255

Example 1

RGB(0,0,255)

Returns the index for the color blue.

Example 2

RGB(RED(Sheet.1!FillForegnd),120,0)

Returns the index for a color whose red component mirrors Sheet.1's fill foreground.