Last active
February 3, 2025 03:47
-
-
Save zoxon/eea23ba49857fb7b11b831a9d90c1022 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @see https://stackoverflow.com/questions/9781218/how-to-change-node-jss-console-font-color | |
* @see https://en.wikipedia.org/wiki/ANSI_escape_code#Colors | |
*/ | |
export const COLOURS = { | |
$: (c: number) => (str: string) => `\x1b[${c}m` + str + '\x1b[0m', | |
gray: (str: string) => COLOURS.$(90)(str), | |
cyan: (str: string) => COLOURS.$(36)(str), | |
yellow: (str: string) => COLOURS.$(33)(str), | |
green: (str: string) => COLOURS.$(32)(str), | |
red: (str: string) => COLOURS.$(31)(str), | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment