1.3.0 • Published 1 year ago

planckcolors v1.3.0

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
1 year ago

planckcolors

Bundlephobia

Possibly the tiniest color library ever. 42 styles in barely 188 bytes of minified, gzipped, golfed, no dependency code. That's 4.5 bytes per style.

import color from 'nanocolor';

console.log(color.red('red'))
console.log(color.green('red'), color.red('red'))

console.log(color.redBg('red background'))
console.log(color.greenBg(color.red('red on green')))

console.log(color.bold(color.redBr('bright bold red'))
console.log(color.bold(color.redBrBG('bright red background +  bold')))

Supported styles

These colors are supported with their variants Bg, Br(ight) and BrBg:

  • black
  • red
  • green
  • yellow
  • blue
  • magenta
  • cyan
  • white
  • black

These additional styles are supported:

  • reset
  • bold
  • dim
  • italic
  • underline
  • blink
  • reverse
  • hide
  • strike

Credits

Thanks to @Posandu for various improvements and ideas.