MACROS and STYLES
All recognized ANSI sequences are stored in the table Ansi.Code, this table is indexed with the sequence name, for each sequence a macro string has been defined to simplify the use of the escape codes, for example:
Ansi.Code.FgBlack Holds the escape sequence needed to set the foreground color to black, you can use this code in your strings like this:
Local myBlackText = Ansi.Code.FgBlack .. "Black world!"
But you can also use a macro strings like this:
Local myBlackText = "~{FBLK}Black world!"
Here is all styles and macros available with a brief description:
Ansi.Code Table | Macro String | Description |
---|---|---|
EFFECTS AND STYLES |
||
.Reset | ~{RSET} | Reset to default values |
.BoldOn | ~{BLD+} | Bold style ON |
.DimOn | ~{DIM+} | Dim style ON |
.ItalicsOn | ~{ITA+} | Italics style ON |
.UnderlineOn | ~{UND+} | Underline style ON |
.BlinkOn | ~{BLI+} | Blink effect ON |
.InverseOn | ~{INV+} | Inverse effect ON |
.HiddenOn | ~{HID+} | Hidden effect ON |
.StrikethroughOn | ~{STR+} | Striketrought effect ON |
.BoldOff | ~{BLD-} | Bold style OFF |
.DimOff | ~{DIM-} | Dim style OFF |
.ItalicsOff | ~{ITA-} | Italics style OFF |
.UnderlineOff | ~{UND-} | Underline style OFF |
.BlinkOff | ~{BLI-} | Blink effect OFF |
.InverseOff | ~{INV-} | Inverse effect OFF |
.HiddenOff | ~{HID-} | Hidden effect OFF |
.StrikethroughOff | ~{STR-} | Striketrought effect OFF |
FOREGROUND COLORS |
||
.FgBlack | ~{FBLK} | Sets foreground color to black |
.FgRed | ~{FRED} | Sets foreground color to red |
.FgGreen | ~{FGRN} | Sets foreground color to green |
.FgYellow | ~{FYEL} | Sets foreground color to yellow |
.FgBlue | ~{FBLU} | Sets foreground color to blue |
.FgMagenta | ~{FMAG} | Sets foreground color to magenta |
.FgCyan | ~{FCYA} | Sets foreground color to cyan |
.FgWhite | ~{FWHI} | Sets foreground color to white |
.FgDefault | ~{FDEF} | Sets foreground color to the default color |
BACKGROUND COLORS |
||
.BgBlack | ~{BBLK} | Sets background color to black |
.BgRed | ~{BRED} | Sets background color to red |
.BgGreen | ~{BGRN} | Sets background color to green |
.BgYellow | ~{BYEL} | Sets background color to yellow |
.BgBlue | ~{BBLU} | Sets background color to blue |
.BgMagenta | ~{BMAG} | Sets background color to magenta |
.BgCyan | ~{BCYA} | Sets background color to cyan |
.BgWhite | ~{BWHI} | Sets background color to white |
.BgDefault | ~{BDEF} | Sets background color to the default color |
CURSOR CODES |
||
.MoveCursor | Used by Ansi.GetCursorMove() | |
.MoveCursorUp | Used by Ansi.GetCursorUp() | |
.MoveCursorUp1 | ~{M1UP} | Move cursor up by 1 row |
.MoveCursorDown | Used by Ansi.GetCursorDown() | |
.MoveCursorDown1 | ~{M1DO} | Move cursor down by 1 row |
.MoveCursorRight | Used by Ansi.GetCursorRight() | |
.MoveCursorRight1 | ~{M1RI} | Move cursor right by 1 column |
.MoveCursorLeft | Used by Ansi.GetCursorLeft() | |
.MoveCursorLeft1 | ~{M1LE} | Move cursor left by 1 column |
.SaveCursor | ~{SAVE} | Save the current cursor position |
.RestoreCursor | ~{REST} | Restore a saved cursor position |
.Home | ~{HOME} | Move the cursor to the home position |
.ShowCursor | ~{SHWC} | Show cursor |
.HideCursor | ~{HIDC} | Hide cursor |
CLEAR CODES |
||
.ClearBelow | ~{CLRB} | Clear all contents below the cursor |
.ClearAbove | ~{CLRA} | Clear all contents above the cursor |
.ClearHome | ~{CLRH} | Clear all and put the cursor on the home position |
.ClearLineRight | ~{CLRR} | Clear all line contents to the right of the cursor |
.ClearLineLeft | ~{CLRL} | Clear all line contents to the left of the cursor |
.ClearLine | ~{CLIN} | Clear the line at the cursor position |
.ClearCharacters | Used by Ansi.GetClearCharacters() | |
.Clear1Character | ~{C1CH} | Clear 1 character |
INSERTION CODES |
||
.InsertBlankLines | Used by Ansi.GetInsertBlankLines() | |
.Insert1BlankLine | ~{I1BL} | Insert 1 blank line |
.InsertCharacters | Used by Ansi.GetInsertCharacters() | |
.Insert1Character | ~{I1CH} | Insert 1 character |
DELETE CODES |
||
.DeleteLines | Used by Ansi.GetDeleteLines() | |
.Delete1Line | ~{D1LI} | Delete 1 line |
.DeleteCharacters | Used by Ansi.GetDeleteCharacters() | |
.Delete1Character | ~{D1CH} | Delete 1 character |
SPECIAL CODES |
||
~{NORM} | Setup the NORMAL style | |
~{NOTI} | Setup the NOTICE style | |
~{WARN} | Setup the WARNING style | |
~{ERRO} | Setup the ERROR style | |
~{ADVI} | Setup the ADVICE style | |
~{QUOT} | Setup the QUOTE style | |
~{PROM} | Setup the PROMPT style |
For more informations about the special codes have a look at the customization section.