UNPKG

micro-ansi

Version:

Easily use 4 bit ANSI colors in your HTML or terminal

40 lines 1.51 kB
// src/index.ts var ansi = { black: (t) => `\x1B[30m${t}\x1B[0m`, red: (t) => `\x1B[31m${t}\x1B[0m`, green: (t) => `\x1B[32m${t}\x1B[0m`, yellow: (t) => `\x1B[33m${t}\x1B[0m`, blue: (t) => `\x1B[34m${t}\x1B[0m`, magenta: (t) => `\x1B[35m${t}\x1B[0m`, cyan: (t) => `\x1B[36m${t}\x1B[0m`, white: (t) => `\x1B[37m${t}\x1B[0m`, brightBlack: (t) => `\x1B[90m${t}\x1B[0m`, brightRed: (t) => `\x1B[91m${t}\x1B[0m`, brightGreen: (t) => `\x1B[92m${t}\x1B[0m`, brightYellow: (t) => `\x1B[93m${t}\x1B[0m`, brightBlue: (t) => `\x1B[94m${t}\x1B[0m`, brightMagenta: (t) => `\x1B[95m${t}\x1B[0m`, brightCyan: (t) => `\x1B[96m${t}\x1B[0m`, brightWhite: (t) => `\x1B[97m${t}\x1B[0m`, bgBlack: (t) => `\x1B[40m${t}\x1B[0m`, bgRed: (t) => `\x1B[41m${t}\x1B[0m`, bgGreen: (t) => `\x1B[42m${t}\x1B[0m`, bgYellow: (t) => `\x1B[43m${t}\x1B[0m`, bgBlue: (t) => `\x1B[44m${t}\x1B[0m`, bgMagenta: (t) => `\x1B[45m${t}\x1B[0m`, bgCyan: (t) => `\x1B[46m${t}\x1B[0m`, bgWhite: (t) => `\x1B[47m${t}\x1B[0m`, bgBrightBlack: (t) => `\x1B[100m${t}\x1B[0m`, bgBrightRed: (t) => `\x1B[101m${t}\x1B[0m`, bgBrightGreen: (t) => `\x1B[102m${t}\x1B[0m`, bgBrightYellow: (t) => `\x1B[103m${t}\x1B[0m`, bgBrightBlue: (t) => `\x1B[104m${t}\x1B[0m`, bgBrightMagenta: (t) => `\x1B[105m${t}\x1B[0m`, bgBrightCyan: (t) => `\x1B[106m${t}\x1B[0m`, bgBrightWhite: (t) => `\x1B[107m${t}\x1B[0m` }; var index_default = ansi; export { index_default as default }; //# sourceMappingURL=index.mjs.map