[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
Function: VGAcolor()
This function makes it possible to change the
color of a specific color register. It works only
on VGA adaptors.
As you may have noted, there are 16 colors to
choose from when in text mode, whilst the VGA
can display up to 218 colors. Now one can select
any of these colors for his text Colors.
Using this function, One can make nice Fading
effects, by making everything black, and then
gently fade in to the actual colors.
Syntax: VGAcolor(<Reg>,<RedValue>,<GreenValue>,<BlueValue>)
Arguments: <Reg> is the color register to adapt, it must
be in the range 0..15 (see Colors info for more
info). The Red, Green and Blue values define the color
to display. They must be in the range 0..63.
Returns: Nothing.
Usage: * - See demo programs..
* - Set black to some random color:
VGAcolor(0,34,54,12)
* - Wondering what color this is eh?.. So do I!
Table: Here's a table with the VGA default values, and
the possibilities offered.
The 16 Standard Colors are defined as Follows:
Color Number Color VGA standard Values:
(Register) Name Red Green Blue
------------------------------------------------------------
0 Black 0 0 0
1 Blue 0 0 42
2 Green 0 42 0
3 Cyan 0 42 42
4 Red 42 0 0
5 Magenta 42 0 42
6 Brown 42 21 0 (*)
7 Gray 42 42 42
8 LightGray 21 21 21
9 LightBlue 21 21 63
10 LightGreen 21 63 21
11 LightCyan 21 63 63
12 LightRed 63 21 21
13 LightMagenta 63 21 63
14 Yellow 63 63 21
15 White 63 63 63
------------------------------------------------------------
(*) I would put "Brown" at 42 42 0, as Brown is really just a
leftover from the CGA era, and 42 42 0 produces a "Normal"
yellow, much nicer than an ugly brown.
See Also:
EGAcolor()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson