Style Module Documentation

IMPORT MOD "STYLE"

The style module includes utilities for coloring and adding styles to displayed text.

Table of Contents


Functions


CLEAR_STYLE

Clears all applied styles

Parameters: None.

Returns: None.

Example Usage:

STYLE("blue")
DISPLAY("This text is blue")
CLEAR_STYLE()
DISPLAY("This text is no longer blue")

STYLE

Applies a style

Parameters:

  • style: String The style type to apply to the text
Default Colors

Style/ColorANSI CodeDescription
clear\x1b[0mResets all styles and colors
default_color\x1b[39mResets the foreground color to default
bg_default_color\x1b[49mResets the background color to default

Foreground Colors

Style/ColorANSI CodeDescription
black\x1b[30mSets the text color to black
red\x1b[31mSets the text color to red
green\x1b[32mSets the text color to green
yellow\x1b[33mSets the text color to yellow
blue\x1b[34mSets the text color to blue
magenta\x1b[35mSets the text color to magenta
cyan\x1b[36mSets the text color to cyan
white\x1b[37mSets the text color to white
bright_black\x1b[90mSets the text color to bright black (gray)
bright_red\x1b[91mSets the text color to bright red
bright_green\x1b[92mSets the text color to bright green
bright_yellow\x1b[93mSets the text color to bright yellow
bright_blue\x1b[94mSets the text color to bright blue
bright_magenta\x1b[95mSets the text color to bright magenta
bright_cyan\x1b[96mSets the text color to bright cyan
bright_white\x1b[97mSets the text color to bright white

Background Colors

Style/ColorANSI CodeDescription
bg_black\x1b[40mSets the background color to black
bg_red\x1b[41mSets the background color to red
bg_green\x1b[42mSets the background color to green
bg_yellow\x1b[43mSets the background color to yellow
bg_blue\x1b[44mSets the background color to blue
bg_magenta\x1b[45mSets the background color to magenta
bg_cyan\x1b[46mSets the background color to cyan
bg_white\x1b[47mSets the background color to white
bg_bright_black\x1b[100mSets the background color to bright black (gray)
bg_bright_red\x1b[101mSets the background color to bright red
bg_bright_green\x1b[102mSets the background color to bright green
bg_bright_yellow\x1b[103mSets the background color to bright yellow
bg_bright_blue\x1b[104mSets the background color to bright blue
bg_bright_magenta\x1b[105mSets the background color to bright magenta
bg_bright_cyan\x1b[106mSets the background color to bright cyan
bg_bright_white\x1b[107mSets the background color to bright white

Text Styles

Style/ColorANSI CodeDescription
bold\x1b[1mMakes the text bold or bright
faint\x1b[2mMakes the text faint or dim
underline\x1b[4mUnderlines the text
blink\x1b[5mMakes the text blink (less supported)

Returns:

  • Bool: TRUE if the style was applied, FALSE if it was not

Example Usage:

STYLE("red")
DISPLAY("This text is red")
CLEAR_STYLE()