Skip to content

VGA Colors#

Disclaimer

Not all terminals support 8-bit VGA colors. If your terminal does support such advanced colors, read on.

Full Text Functions#

vga(text, vga) #

Prints full line of 8-bit VGA-colored text.

Parameters:

Name Type Description Default
text str

Text to be printed with color.

required
vga int

Number between 0 and 255.

required
Example
1
2
3
from colorist import vga

vga("I want this text in blue VGA colors", 33)

How it appears in the terminal:

% I want this text in blue VGA colors

bg_vga(text, vga) #

Prints full line of text on 8-bit VGA-colored background.

Parameters:

Name Type Description Default
text str

Text to be printed on colored background.

required
vga int

Number between 0 and 255.

required
Example
1
2
3
from colorist import vga

bg_vga("I want this background in blue VGA colors", 33)

How it appears in the terminal:

% I want this background in blue VGA colors

Custom String Styling#

ColorVGA(vga)#

Class for custom 8-bit VGA foreground text color.

Parameters:

Name Type Description Default
vga int

Number between 0 and 255.

required
Example
1
2
3
4
5
from colorist import ColorVGA

lime_green = ColorVGA(120)

print(f"I want to use {lime_green}lime green{lime_green.OFF} color inside this paragraph")

How it appears in the terminal:

% I want to use lime green color inside this paragraph

BgColorVGA(vga)#

Class for custom 8-bit VGA background color instances.

Parameters:

Name Type Description Default
vga int

Number between 0 and 255.

required
Example
1
2
3
4
5
from colorist import BgColorVGA

bg_lime_green = BgColorVGA(120)

print(f"I want to use {bg_lime_green}lime green{bg_lime_green.OFF} background color inside this paragraph")

How it appears in the terminal:

% I want to use lime green background color inside this paragraph