Download api/src/misc/console-text.js from Dieiol919/cobalt: direct link, hf CLI and curl.
- Browser
- Download file 640 Bytes
-
https://huggingface.co/Dieiol919/cobalt/resolve/main/api/src/misc/console-text.js
- Command line
-
hf download hf://Dieiol919/cobalt/api/src/misc/console-text.js
-
curl -L -o console-text.js https://huggingface.co/Dieiol919/cobalt/resolve/main/api/src/misc/console-text.js
640 Bytes
| const ANSI = { | |
| RESET: "\x1b[0m", | |
| BRIGHT: "\x1b[1m", | |
| RED: "\x1b[31m", | |
| GREEN: "\x1b[32m", | |
| CYAN: "\x1b[36m", | |
| YELLOW: "\x1b[93m" | |
| } | |
| function wrap(color, text) { | |
| if (!ANSI[color.toUpperCase()]) { | |
| throw "invalid color"; | |
| } | |
| return ANSI[color.toUpperCase()] + text + ANSI.RESET; | |
| } | |
| export function Bright(text) { | |
| return wrap('bright', text); | |
| } | |
| export function Red(text) { | |
| return wrap('red', text); | |
| } | |
| export function Green(text) { | |
| return wrap('green', text); | |
| } | |
| export function Cyan(text) { | |
| return wrap('cyan', text); | |
| } | |
| export function Yellow(text) { | |
| return wrap('yellow', text); | |
| } | |