trucolor
TypeScript icon, indicating that this package has built-in type declarations

4.0.4 • Public • Published

TruColor

A node module and CLI utility for using 24bit color SGR codes in modern terminals.

Publishing Status

npm Libraries.io
Travis Rollup

Development Status

Travis Libraries.io
Snyk Code-Climate Code-Climate Coverage

Documentation/Help

Twitter

v4 Breaking change The CLI command has been seperated into it's own repo trucolor-cli

Usage

Installation

npm install --save @thebespokepixel/trucolor

Usage

import {trucolor, palette, chalkish, simple} from 'trucolor'

const simpleColor = trucolor('bright red')
console.log(`${simpleColor.in}simpleColor${simpleColor.out}`)

const simplePalette = simple()
console.log(`${simplePalette.red}simplePalette Red${simplePalette.red.out}`)
console.log(`${simplePalette.blue}simplePalette Blue${simplePalette.blue.out}`)

const myPalette = palette({}, {
  red: '#F00',
  blue: 'lighten 30 blue'
})
console.log(`${myPalette.red}myPalette Red${myPalette.red.out}`)
console.log(`${myPalette.blue}myPalette Blue${myPalette.blue.out}`)

const myChalkishPalette = chalkish(palette({}, {
  red: '#F00',
  blue: 'lighten 30 blue'
}))
console.log(myChalkishPalette.red('myChalkishPalette Red'))
console.log(myChalkishPalette.blue('myChalkishPalette Blue'))

See es-tinycolour for complete colour input syntax.

Documentation

Full documentation can be found at https://thebespokepixel.github.io/trucolor/

Package Sidebar

Install

npm i trucolor

Weekly Downloads

21

Version

4.0.4

License

MIT

Unpacked Size

33.7 kB

Total Files

5

Last publish

Collaborators

  • thebespokepixel