Official Content

Returns a number representing an RGB color value.

Syntax

RGB(Numeric-expression1, Numeric-expression2, Numeric-expression3)

Where:

Numeric-expression1
   Number in the range from 0 to 255, inclusively, representing the red component of the color.

Numeric-expression2 
   Number in the range from 0 to 255, inclusively, representing the green component of the color.

Numeric-expression3
   Number in the range from 0 to 255, inclusively, representing the blue component of the color.

Type Returned:
Numeric

Scope

Objects: Procedure, Transaction, Web Panel, Panel, Data Provider
Generators: .NET, .NET FrameworkJava, Ruby (up to GeneXus X Evolution 3), RPG, Visual FoxPro (up to GeneXus X Evolution 3), Cobol, Apple, Android, Angular

Description

Controls that accept a color specification, expecting it to be a number representing an RGB color value. An RGB color value specifies the relative intensity of red, green, and blue to cause a specific color to be displayed.

The value of any argument to RGB exceeding 255 is assumed to be 255.

The following table lists a number of standard colors, and the red, green, and blue values they include:

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

Samples

ProdDesc.Backcolor = RGB(255,255,255)

ProdDesc is an Edit control and its backcolor is white.

See Also

Color function

Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant