UNPKG

colorate

Version:

A simple and lightweight terminal stylizer.

50 lines (47 loc) 2.2 kB
const _ = `\x1B[`; const bold = (v) => `${_}1m${v}${_}22m`; const crossout = (v) => `${_}9m${v}${_}29m`; const darken = (v) => `${_}2m${v}${_}22m`; const hidden = (v) => `${_}8m${v}${_}28m`; const invert = (v) => `${_}7m${v}${_}27m`; const italic = (v) => `${_}3m${v}${_}23m`; const reset = (v) => `${_}0m${v}${_}0m`; const underline = (v) => `${_}4m${v}${_}24m`; const amber = (v) => `${_}33m${v}${_}39m`; const bgAmber = (v) => `${_}43m${v}${_}49m`; const black = (v) => `${_}30m${v}${_}39m`; const bgBlack = (v) => `${_}40m${v}${_}49m`; const blue = (v) => `${_}94m${v}${_}39m`; const bgBlue = (v) => `${_}104m${v}${_}49m`; const cyan = (v) => `${_}96m${v}${_}39m`; const bgCyan = (v) => `${_}106m${v}${_}49m`; const gray = (v) => `${_}90m${v}${_}39m`; const bgGray = (v) => `${_}100m${v}${_}49m`; const green = (v) => `${_}32m${v}${_}39m`; const bgGreen = (v) => `${_}42m${v}${_}49m`; const indigo = (v) => `${_}34m${v}${_}39m`; const bgIndigo = (v) => `${_}104m${v}${_}49m`; const lime = (v) => `${_}92m${v}${_}39m`; const bgLime = (v) => `${_}102m${v}${_}49m`; const magenta = (v) => `${_}35m${v}${_}39m`; const bgMagenta = (v) => `${_}45m${v}${_}49m`; const pink = (v) => `${_}95m${v}${_}39m`; const bgPink = (v) => `${_}105m${v}${_}49m`; const red = (v) => `${_}31m${v}${_}39m`; const bgRed = (v) => `${_}41m${v}${_}49m`; const rose = (v) => `${_}91m${v}${_}39m`; const bgRose = (v) => `${_}101m${v}${_}49m`; const silver = (v) => `${_}37m${v}${_}39m`; const bgSilver = (v) => `${_}47m${v}${_}49m`; const sky = (v) => `${_}36m${v}${_}39m`; const bgSky = (v) => `${_}46m${v}${_}49m`; const white = (v) => `${_}97m${v}${_}39m`; const bgWhite = (v) => `${_}107m${v}${_}49m`; const yellow = (v) => `${_}93m${v}${_}39m`; const bgYellow = (v) => `${_}103m${v}${_}49m`; const cl = console.log; const cw = console.warn; const ce = console.error; const n = ` `; export { amber, bgAmber, bgBlack, bgBlue, bgCyan, bgGray, bgGreen, bgIndigo, bgLime, bgMagenta, bgPink, bgRed, bgRose, bgSilver, bgSky, bgWhite, bgYellow, black, blue, bold, ce, cl, crossout, cw, cyan, darken, gray, green, hidden, indigo, invert, italic, lime, magenta, n, pink, red, reset, rose, silver, sky, underline, white, yellow };