@kaskadi/better-colors

1.2.5 • Public • Published

GitHub Actions workflows status

Build workflow status Publish workflow status

CodeClimate


Installation

npm i @kaskadi/better-colors

API documentation

better-colors

Generate ANSI color code for the given color

Param Type Description
color string Color to convert to equivalent ANSI code. Accepts: regular color names (red, etc.), RGB and HEX.

Properties

Name Type Default Description
[RESET] string '\x1b[0m' Gives the ANSI code to reset colors in terminal.

Example

const color = require('better-colors')

// will all print '\u001b[38;2;255;0;0m\u001b[10m'
console.log(color('red'))
console.log(color('#ff0000'))
console.log(color(255, 0, 0))

// will print '\u001b[48;2;255;0;0m\u001b[10m'
console.log(color('red', 1))

// will print '\x1b[0m'
console.log(color.RESET)

Readme

Keywords

none

Package Sidebar

Install

npm i @kaskadi/better-colors

Weekly Downloads

10

Version

1.2.5

License

MIT

Unpacked Size

16.5 kB

Total Files

13

Last publish

Collaborators

  • holgerwill
  • alexlemaire