1 | # Colorful
|
2 |
|
3 | It's not just color, it's everything colorful in terminal.
|
4 |
|
5 | ---------------------
|
6 |
|
7 | # Color
|
8 |
|
9 | Color in terminal and only terminal.
|
10 |
|
11 | ![screen shot](./screen-shot.png)
|
12 |
|
13 | ## Programmer
|
14 |
|
15 | As a programmer, you think they are functions:
|
16 |
|
17 | ```javascript
|
18 | var color = require('colorful')
|
19 | color.red('hello')
|
20 | color.underline('hello')
|
21 | color.red(color.underline('hello'))
|
22 | ```
|
23 |
|
24 | ## Human
|
25 |
|
26 | As a human, you think you are a painter:
|
27 |
|
28 | ```javascript
|
29 | var paint = require('colorful').paint
|
30 | paint('hello').red.color
|
31 | paint('hello').bold.underline.red.color
|
32 | ```
|
33 |
|
34 | **WTF**, is bold, underline a color? If you don't like the idea, try:
|
35 |
|
36 | ```javascript
|
37 | paint('hello').bold.underline.red.style
|
38 | ```
|
39 |
|
40 | ## Alien
|
41 |
|
42 | As an alien, you are from outer space, you think it should be:
|
43 |
|
44 | ```javascript
|
45 | require('colorful').colorful()
|
46 | 'hello'.to.red.color
|
47 | 'hello'.to.underline.bold.red.color
|
48 | 'hello'.to.underline.bold.red.style
|
49 | ```
|
50 |
|
51 |
|
52 | ## Artist
|
53 |
|
54 | As an artist, you need more colors.
|
55 |
|
56 | ```javascript
|
57 | var Color = require('colorful').Color;
|
58 |
|
59 | var s = new Color('colorful');
|
60 | s.fgcolor = 13;
|
61 | s.bgcolor = 61;
|
62 | ```
|
63 |
|
64 | Support ANSI 256 colors. [0 - 255]
|
65 |
|
66 | ## Detective
|
67 |
|
68 | As a detective, you think we should detect if color is supported:
|
69 |
|
70 | ```javascript
|
71 | require('colorful').isSupported
|
72 |
|
73 | // we can disable color
|
74 | require('colorful').disabled = true
|
75 | require('colorful').isSupported
|
76 | // => false
|
77 | ```
|
78 |
|
79 | # Colors
|
80 |
|
81 | - bold
|
82 | - faint
|
83 | - italic
|
84 | - underline
|
85 | - blink
|
86 | - overline
|
87 | - inverse
|
88 | - conceal
|
89 | - strike
|
90 | - black
|
91 | - black_bg
|
92 | - red
|
93 | - red_bg
|
94 | - green
|
95 | - green_bg
|
96 | - yellow
|
97 | - yellow_bg
|
98 | - blue
|
99 | - blue_bg
|
100 | - magenta
|
101 | - magenta_bg
|
102 | - cyan
|
103 | - cyan_bg
|
104 | - white
|
105 | - white_bg
|
106 | - grey
|
107 | - gray
|
108 |
|
109 | # Changelog
|
110 |
|
111 | **2013-03-22** `2.0.2`
|
112 |
|
113 | Merge terminal into ansi.
|
114 |
|
115 | **2013-03-18** `2.0.1`
|
116 |
|
117 | Add gray color.
|
118 |
|
119 | **2013-03-18** `2.0.0`
|
120 |
|
121 | Redesign. Support for ANSI 256 colors.
|