Intrinsic-69 Attrib

Top  Previous  Next

69: Attrib(colors);   (Changed)

 

This intrinsic specifies the colors (attributes) used when sending characters to device 6. The meaning of the attributes depends on the number of bits in the Video Mode setting.

 

1. 1-Bit Modes. In these modes the high nibble of the argument sets the background color, and the low nibble sets the foreground color. Since there is only one bit, you only have the choice of black or white for the foreground or background colors.

 


BACKGROUND

 

FOREGROUND

$00:

Black

$00

Black

$10

White

$01

White

 

 

2. 2-Bit Modes. In these modes the high nibble of the argument sets the background color, and the low nibble sets the foreground color. With two bits you have a choice of 4 colors for the  foreground or background.

 


BACKGROUND

 

FOREGROUND

$00:

Black

$00

Black

$10

Cyan

$01

Cyan

$20

Magenta

$02

Magenta

$30

Gray

$03

Gray

 

 

3. 4-Bit modes. In these modes the high nibble of the argument sets the background color, and the low nibble sets the foreground color. You have a choice of 16 colors for both the foreground and background. Flashing colors are not available in the current VGA emulation.

 


BACKGROUND

 

FOREGROUND

$00:

Black

$00

Black

$10

Blue

$01

Blue

$20

Green

$02

Green

$30

Cyan

$03

Cyan

$40

Red

$04

Red

$50

Magenta

$05

Magenta

$60

Brown

$06

Brown

$70

White

$07

White

$80

Flashing Black

$08

Gray

$90

Flashing Blue

$09

Light Blue

$A0

Flashing Green

$0A

Light Green

$B0

Flashing Cyan

$0B

Light Cyan

$C0

Flashing Red

$0C

Light Red

$D0

Flashing Magenta

$0D

Light Magenta

$E0

Flashing Brown

$0E

Yellow

$F0

Flashing White

$0F

Bright White

 

 

4. 8-Bit Modes. In these modes the low 8 bits of the argument specifies the Foreground Color and the next 8 bits specifies the background color. The colors are taken from the standard palette of 256 VGA colors. You can also set your own palette using the SetPalette intrinsic.

 

VGAPalette

 

5. 15-Bit Modes. In these modes a color is specified as an RGB value of 5 bits each. Thus the low 16 bits of the attribute contains 15 bits of color information for the Foreground Color. Likewise, the high 16 bits of the Attribute contains 15 bits of Background Color information.

 

6. 16-Bit Modes. In these modes a color is specified as an RGB value of 5, 6 and 5 bits, with the green value getting the extra bit. Thus the low 16 bits of the attribute contains a 5-6-5 color value for the Foreground Color. Likewise, the high 16 bits of the Attribute contains  a 5-6-5 color value for Background Color.

 

7. 24-Bit Modes. In these modes the background color is always black, and the foreground color is represented by RGB values of 8 bits per color.