RGBColor Command

Purpose

Sets the foreground and background color for graphic output.

Syntax

RGBColor fore [, back]

fore, back:integer expression

Description

RGBColor sets the foreground or background color (or both) using a RGB-Value. A RGB value is composed using the RGB function, which takes three byte values, each specifying a color tint red = 0..255, green = 0..255, and blue = 0..255.

When the system uses a palette the parameters specify a palette index.

Example

OpenW 1

Local b&, g&, i&, j&, r&

DefLine 6, 4

For i& = 0 To _X Step 4

For j& = 0 To _Y Step 4

r& = SinQ((i& + j&) / 4) * 127 + 128

g& = SinQ(j& / 2) * 127 + 128

b& = SinQ(i& / 2) * 127 + 128

RGBColor RGB(r&, g&, b&)

Line i&, j&, i&, j&

Next j&

Next i&

DefLine 0, 1

Usage of the SysCol function:

OpenW 1

Local a%, b%

a% = SysCol(COLOR_BTNFACE)

b% = SysCol(COLOR_BTNTEXT)

RGBColor a%, b%

Text 10, 10, "HALLO GFA"

Remarks

Color internally uses RGBColor, so Color is a short form of RGBColor.

See Also

Color, QBColor, ForeColor, BkColor

{Created by Sjouke Hamstra; Last updated: 22/10/2014 by James Gaite}