Please enable JavaScript to view this site.

thinBasic Help Manual

* * HELP & MANUAL PREMIUM PACK 4 DEMO VERSION * *

This documentation was styled with a demo skin from the Premium Pack 4 add-on for Help & Manual. The contents of the skin are encrypted and not configurable. You can only publish HM projects with this skin. You cannot edit it or change it.

This version is copyright and may only be used for local testing purposes. It may not be distributed.

Please purchase the full version of the Premium Pack to get the configurable skins and remove this notice. The package will also include the Toolbox configuration utility for Premium Pack skins.

 

Description

 

Return an RGB color value.

 

Syntax

 

n = RGB(Red, Green, Blue)

n = RGB(BGRColor)

 

Returns

 

Number

 

Parameters

 

Name

Type

Optional

Meaning

Red

Numeric

No

A number from 0 to 255

Green

Numeric

No

A number from 0 to 255

Blue

Numeric

No

A number from 0 to 255

 

Remarks

 

An RGB value is a long integer value in the range of 0 to &H00FFFFFF. It is used to specify a color.

The lowest three bytes of the value each specify the intensity of a primary color which combine to form the resultant color.

Byte 1 (lowest) represents the red component, byte 2 the green, and byte 3 the blue.  They can each take on a value in the range of 0 to 255.

Byte 4 (highest) is always 0.

 

When used with 3 parameters, the RGB() function creates an RGB value from the three component values.

 

When used with one parameter, this function translates a BGR value to its RGB equivalent by swapping the first byte with the third byte, and returning the result.

 

For example, the BGR value of red is &H000000FF. RGB() translates it to &H00FF0000.  Calling BGR() with that value converts it back to &H00FF0000.

 

Restrictions

 

See also

 

BGR

 

Examples

 

 

 

 

Created with Help+Manual 8 and styled with Premium Pack Version 4 © by EC Software