Skip to content

RGB_R

Returns the red component (as an Integer) from a given RGBA colour value.

Syntax: RGB_R( RGBA )

RGBA
required A Long RGBA colour value, of the kind returned by RGB or RGBA.

The return value is the red component in the range 0--255.

Example

This example extracts the red component from a colour built with RGB.

vb
Dim MyColor As Long
Dim RedComponent As Integer
MyColor = RGB(255, 100, 150)
RedComponent = RGB_R(MyColor)         ' Returns 255.

See Also

twinBASIC and LOGO copyright of "WaynePhillipsEA" author