blob: 711c006956570331b66492df64d4e942398661fb (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
#Chroma - Simple terminal colors for Node.js
##Contents
1. [Install](#install)
2. [Introduction](#introduction)
3. [API](#api)
* [chroma \[color\]()](#chroma-color)
* [chroma()](#chroma)
5. [License](#license)
<br />
##Install
`````text
npm install kagami
`````
<br />
##Introduction
Chroma is a quick and easy way to print colors in Node.js terminal applications.
`````javascript
console.log('My favorite colors are ' + chroma.blue('blue') + ' and ' + chroma.white('white') + '!');
//My favorite colors are blue and white!
`````
Chroma supports the following ASCII colors:
+ Black
+ Red
+ Green
+ Yellow
+ Blue
+ Magenta
+ Cyan
+ White
<br />
##API
<br />
###chroma \[color\]()
Returns the given text wrapped in the correct ASCII color.
Usage:
> **chroma \[color\]( text )**
`````javascript
console.log(chroma.blue('This will be blue!'));
`````
<br />
###chroma()
Returns a generator function that can be used to produce the ASCII color that is closest to the supplied value. Accepts Hex and RGB values!
Usage:
> **chroma ( hex string )**
> ** chroma ( red value, green value, blue value )**
`````javascript
var blueifier = chroma('#00FFFF');
var redifier = chroma(255, 12, 5);
console.log(blueifier('This will be blue!'));
console.log(redifier('This will probably be red!'));
`````
<br />
##License
Chroma is MIT licensed. You can read the license [here](https://raw.github.com/pachet/chroma/master/license).
|