1.2.5 • Published 3 years ago

@kaskadi/better-colors v1.2.5

Weekly downloads
9
License
MIT
Repository
github
Last release
3 years ago

npm.io npm.io npm.io

GitHub Actions workflows status

Build workflow status Publish workflow status

CodeClimate

npm.io npm.io npm.io


Installation

npm i @kaskadi/better-colors

API documentation

better-colors

Generate ANSI color code for the given color

ParamTypeDescription
colorstringColor to convert to equivalent ANSI code. Accepts: regular color names (red, etc.), RGB and HEX.

Properties

NameTypeDefaultDescription
[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)
1.2.5

3 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago

0.0.1

4 years ago