UNPKG

1.76 kBMarkdownView Raw
1# Colorful
2
3It's not just color, it's everything colorful in terminal.
4
5---------------------
6
7# Color
8
9Color in terminal and only terminal.
10
11![screen shot](./screen-shot.png)
12
13## Programmer
14
15As a programmer, you think they are functions:
16
17```javascript
18var color = require('colorful')
19color.red('hello')
20color.underline('hello')
21color.red(color.underline('hello'))
22```
23
24## Human
25
26As a human, you think you are a painter:
27
28```javascript
29var paint = require('colorful').paint
30paint('hello').red.color
31paint('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
37paint('hello').bold.underline.red.style
38```
39
40## Alien
41
42As an alien, you are from outer space, you think it should be:
43
44```javascript
45require('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
54As an artist, you need more colors.
55
56```javascript
57var Color = require('colorful').Color;
58
59var s = new Color('colorful');
60s.fgcolor = 13;
61s.bgcolor = 61;
62```
63
64Support ANSI 256 colors. [0 - 255]
65
66## Detective
67
68As a detective, you think we should detect if color is supported:
69
70```javascript
71require('colorful').isSupported
72
73// we can disable color
74require('colorful').disabled = true
75require('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
113Merge terminal into ansi.
114
115**2013-03-18** `2.0.1`
116
117Add gray color.
118
119**2013-03-18** `2.0.0`
120
121Redesign. Support for ANSI 256 colors.