Interpretation dictionary and enums

The ansiscape.Interpretation dictionary describes an interpretation of one or more ANSI escape codes.

Keys

Key Type Description
background MetaColor, NamedColor, RGBA or MetaInterpretation Background colour
blink Blink or MetaInterpretation Blink rate
calligraphy Calligraphy or MetaInterpretation Calligraphy
conceal bool or MetaInterpretation Conceal/reveal
font Font or MetaInterpretation Font face
foreground MetaColor, NamedColor, RGBA or MetaInterpretation Foreground colour
frame Frame or MetaInterpretation Framing
ideogram Ideogram or MetaInterpretation Ideogram
invert bool or MetaInterpretation Invert background/foreground
overline bool or MetaInterpretation Overline
proportional_spacing bool or MetaInterpretation Proportional spacing
strike bool or MetaInterpretation Strikethrough
underline Underline or MetaInterpretation Underline
weight Weight or MetaInterpretation Weight

Types

Import the Blink enum from ansiscape.enums.

Value JSON Description
Blink.FAST 2 Blink the text rapidly
Blink.NONE 0 Do not blink the text
Blink.SLOW 1 Blink the text slowly

Calligraphy

Import the Calligraphy enum from ansiscape.enums.

Value JSON Description
Calligraphy.BLACKLETTER 1 Blackletter script, also known as fraktur or gothic
Calligraphy.ITALIC 2 Italic script
Calligraphy.NONE 0 No calligraphy

Font

Import the Font enum from ansiscape.enums.

Value JSON Description
Font.ALT_0 1 First alternative font
Font.ALT_1 2 Second alternative font
Font.ALT_2 3 Third alternative font
Font.ALT_3 4 Fourth alternative font
Font.ALT_4 5 Fifth alternative font
Font.ALT_5 6 Sixth alternative font
Font.ALT_6 7 Seventh alternative font
Font.ALT_7 8 Eighth alternative font
Font.ALT_8 9 Ninth alternative font
Font.DEFAULT 0 The terminal's default font

Frame

Import the Frame enum from ansiscape.enums.

Value JSON Description
Frame.BOX 1 Frame
Frame.CIRCLE 2 Encircle
Frame.NONE 0 No framing

Ideogram

Import the Ideogram enum from ansiscape.enums.

Value JSON Description
Ideogram.DOUBLE_LINE_OVER_OR_LEFT 4 Double line over or left
Ideogram.DOUBLE_LINE_UNDER_OR_RIGHT 2 Double line under or right
Ideogram.NONE 0 No ideogram
Ideogram.SINGLE_LINE_OVER_OR_LEFT 3 Single line over or left
Ideogram.SINGLE_LINE_UNDER_OR_RIGHT 1 Single line under or right
Ideogram.STRESS 5 Stress

MetaColor

Import the MetaColor enum from ansiscape.enums.

Value JSON Description
MetaColor.DEFAULT -1 The terminal's default colour

MetaInterpretation

Import the MetaInterpretation enum from ansiscape.enums.

Value JSON Description
MetaInterpretation.REVERT -2 Revert the property to its previous value

NamedColor

Import the NamedColor enum from ansiscape.enums.

Value JSON Description
NamedColor.BLACK 0 Black
NamedColor.BLUE 4 Blue
NamedColor.BRIGHT_BLACK 8 Bright black
NamedColor.BRIGHT_BLUE 12 Bright blue
NamedColor.BRIGHT_CYAN 14 Bright cyan
NamedColor.BRIGHT_GREEN 10 Bright green
NamedColor.BRIGHT_MAGENTA 13 Bright magenta
NamedColor.BRIGHT_RED 9 Bright red
NamedColor.BRIGHT_WHITE 15 Bright white
NamedColor.BRIGHT_YELLOW 11 Bright yellow
NamedColor.CYAN 6 Cyan
NamedColor.GREEN 2 Green
NamedColor.MAGENTA 5 Magenta
NamedColor.RED 1 Red
NamedColor.WHITE 7 White
NamedColor.YELLOW 3 Yellow

RGBA

RGBA is a tuple of (float, float, float, int) describing the red (0.0-1.0), green (0.0-1.0), blue (0.0-1.0) and alpha (0 or 1) components of a colour.

Underline

Import the Underline enum from ansiscape.enums.

Value JSON Description
Underline.DOUBLE 2 Double underline
Underline.NONE 0 No underline
Underline.SINGLE 1 Single underline

Weight

Import the Weight enum from ansiscape.enums.

Value JSON Description
Blink.HEAVY 1 Heavy, also known as bold or intense
Blink.LIGHT -1 Light, also known as dim or faint
Blink.NORMAL 0 Normal