Nano-RGB
A tiny (~200B) chalk replacement for simple RGB terminal text.
Usage
There are two functions.
The first rgb
injects a string with an ANSI RGB code after the escape sequence, all you need to worry about is the RGB.
console
The second mix
takes an RGB function and a message string, then returns the colored and reset string.
const red = console
Finally there is the utility function reset
that always returns the command line to the default color.
console
Here's a full example that does some weird color stuff, enjoy.
const rgb = for let i = 0; i < 25; i++ let out = ''; for let y = 0; y < 25; y++ out += + '><' console;