ansi is a collection of utility functions for creating ansi/vt100-style escape sequences.
To be able to load this module within slope via
load-mod clone this folder into your main modules folder (see
Every proc in the module evaluates to a string (ie. it does not display/write the value).
(ansi-curs-pos [row: number] [col: number])
(ansi-curs-up [row-count: number])
(ansi-curs-down [row-count: number])
(ansi-curs-forward [col-count: number])
(ansi-curs-back [col-count: number])
(ansi-color [fg: number|list] [bg: number|list])
ansi-colorhas some premade lists available that form color pairs for easy passing by name:
(ansi-true-color-fg [r: number] [g: number] [b: number])
(ansi-true-color-bg [r: number] [g: number] [b: number])
(load-mod "ansi") (define writer (string-make-buf)) (write (ansi-true-color-fg 200 50 50) writer) (write (ansi-true-color-bg 255 255 255) writer) (write "Hello, color!" writer) (write (ansi-att-reset) writer) (display (read-all writer) "\n")
The above should output something red text on a white background.