VBScript RGB Function

Definition and Usage

The RGB function can return a number representing the RGB color value.

Syntax

RGB(red,green,blue)
Parameter Description
red Required. A number between 0 - 255 (inclusive) representing the red part of the color.
green Required. A number between 0 - 255 (inclusive) representing the green part of the color.
blue Required. A number between 0 - 255 (inclusive) representing the blue part of the color.

Instance

Example 1

document.write(rgb(255,0,0))

Output:

255

Example 2

document.write(rgb(255,30,30))

Output:

1974015