Skip to content

QBColor

Returns a Long representing the RGB colour code corresponding to the specified colour number.

Syntax: QBColor( color )

color
required A whole number in the range 0--15.

The color argument has these settings:

NumberColourNumberColour
0Black8Gray
1Blue9Light Blue
2Green10Light Green
3Cyan11Light Cyan
4Red12Light Red
5Magenta13Light Magenta
6Yellow14Light Yellow
7White15Bright White

The color argument represents colour values used by earlier versions of Basic --- Microsoft Visual Basic for MS-DOS and the QuickBASIC compiler. Starting with the least-significant byte, the returned value specifies the red, green, and blue components used to set the corresponding colour in the RGB system, exactly as if RGB had been called with those components.

Example

This example uses QBColor to set a form's background colour from a numeric colour code.

vb
Sub ChangeBackColor(ByVal ColorCode As Integer, ByVal MyForm As Form)
    MyForm.BackColor = QBColor(ColorCode)
End Sub

See Also

twinBASIC and LOGO copyright of "WaynePhillipsEA" author