https://github.com/thebespokepixel/trucolor
24bit color tools for the command line
https://github.com/thebespokepixel/trucolor
24-bit cli color console node-module npm sgr terminal
Last synced: 9 months ago
JSON representation
24bit color tools for the command line
- Host: GitHub
- URL: https://github.com/thebespokepixel/trucolor
- Owner: thebespokepixel
- License: other
- Created: 2014-11-03T17:43:00.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2024-11-13T18:42:54.000Z (over 1 year ago)
- Last Synced: 2025-04-30T21:07:05.391Z (about 1 year ago)
- Topics: 24-bit, cli, color, console, node-module, npm, sgr, terminal
- Language: JavaScript
- Homepage: https://thebespokepixel.github.io/trucolor/
- Size: 21.2 MB
- Stars: 8
- Watchers: 1
- Forks: 5
- Open Issues: 6
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
![TruColor][logo]
> A node module and CLI utility for using 24bit color SGR codes in modern terminals.
##### Publishing Status
[](https://www.npmjs.com/package/trucolor "npm") [](https://libraries.io/github/thebespokepixel/trucolor "Libraries.io")
[](https://travis-ci.com/thebespokepixel/trucolor "Travis") [](https://github.com/rollup/rollup/wiki/pkg.module "Rollup")
##### Development Status
[](https://travis-ci.com/thebespokepixel/trucolor "Travis") [](https://libraries.io/github/thebespokepixel/trucolor "Libraries.io")
[](https://snyk.io/test/github/thebespokepixel/trucolor "Snyk") [](https://codeclimate.com/github/thebespokepixel/trucolor/maintainability "Code-Climate") [](https://codeclimate.com/github/thebespokepixel/trucolor/test_coverage "Code-Climate Coverage")
##### Documentation/Help
[](https://twitter.com/thebespokepixel "Twitter")
> **v4 Breaking change** The CLI command has been seperated into it's own repo [`trucolor-cli`][2]
## Usage
#### Installation
```shell
npm install --save @thebespokepixel/trucolor
```
## Usage
```javascript
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][3] for complete colour input syntax.
## Documentation
Full documentation can be found at [https://thebespokepixel.github.io/trucolor/][1]
[1]: https://thebespokepixel.github.io/trucolor/
[2]: https://github.com/thebespokepixel/trucolor-cli
[3]: https://github.com/thebespokepixel/es-tinycolor
[logo]: https://raw.githubusercontent.com/thebespokepixel/trucolor/master/media/banner.png