Export (0) Print
Expand All
Expand Minimize

RGB Function (VisioShapeSheet)

Last modified: June 17, 2011

Applies to: Office 2013 | Visio 2013

In this article
Syntax
Remarks
Example 1
Example 2

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.

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

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

RGB(0,0,255)

Returns the index for the color blue.

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

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

Show:
© 2014 Microsoft