We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b4d964b commit 56de9f0Copy full SHA for 56de9f0
README.md
@@ -29,6 +29,16 @@ Please check out the [roadmap](ROADMAP.md) for upcoming features and releases.
29
- gray
30
- grey
31
32
+### bright text colors
33
+
34
+ - brightRed
35
+ - brightGreen
36
+ - brightYellow
37
+ - brightBlue
38
+ - brightMagenta
39
+ - brightCyan
40
+ - brightWhite
41
42
### background colors
43
44
- bgBlack
@@ -39,6 +49,18 @@ Please check out the [roadmap](ROADMAP.md) for upcoming features and releases.
49
- bgMagenta
50
- bgCyan
51
- bgWhite
52
+ - bgGray
53
+ - bgGrey
54
55
+### bright background colors
56
57
+ - bgBrightRed
58
+ - bgBrightGreen
59
+ - bgBrightYellow
60
+ - bgBrightBlue
61
+ - bgBrightMagenta
62
+ - bgBrightCyan
63
+ - bgBrightWhite
64
65
### styles
66
examples/normal-usage.js
@@ -29,6 +29,7 @@ console.log('Background color attack!'.black.bgWhite);
console.log('Use random styles on everything!'.random);
console.log('America, Heck Yeah!'.america);
+console.log('Blindingly '.brightCyan + 'bright? '.brightRed + 'Why '.brightYellow + 'not?!'.brightGreen);
console.log('Setting themes is useful');
examples/safe-string.js
@@ -28,6 +28,8 @@ console.log(colors.black.bgWhite('Background color attack!'));
28
console.log(colors.random('Use random styles on everything!'));
console.log(colors.america('America, Heck Yeah!'));
+console.log(colors.brightCyan('Blindingly ') + colors.brightRed('bright? ') + colors.brightYellow('Why ') + colors.brightGreen('not?!'));
//
lib/maps/random.js
@@ -1,6 +1,7 @@
1
module['exports'] = function(colors) {
2
var available = ['underline', 'inverse', 'grey', 'yellow', 'red', 'green',
3
- 'blue', 'white', 'cyan', 'magenta'];
+ 'blue', 'white', 'cyan', 'magenta', 'brightYellow', 'brightRed',
4
+ 'brightGreen', 'brightBlue', 'brightWhite', 'brightCyan', 'brightMagenta'];
5
return function(letter, i, exploded) {
6
return letter === ' ' ? letter :
7
colors[
lib/styles.js
@@ -48,6 +48,14 @@ var codes = {
48
gray: [90, 39],
grey: [90, 39],
+ brightRed: [91, 39],
+ brightGreen: [92, 39],
+ brightYellow: [93, 39],
+ brightBlue: [94, 39],
+ brightMagenta: [95, 39],
+ brightCyan: [96, 39],
+ brightWhite: [97, 39],
bgBlack: [40, 49],
bgRed: [41, 49],
bgGreen: [42, 49],
@@ -56,6 +64,16 @@ var codes = {
bgMagenta: [45, 49],
bgCyan: [46, 49],
bgWhite: [47, 49],
67
+ bgGray: [100, 49],
68
+ bgGrey: [100, 49],
69
70
+ bgBrightRed: [101, 49],
71
+ bgBrightGreen: [102, 49],
72
+ bgBrightYellow: [103, 49],
73
+ bgBrightBlue: [104, 49],
74
+ bgBrightMagenta: [105, 49],
75
+ bgBrightCyan: [106, 49],
76
+ bgBrightWhite: [107, 49],
77
78
// legacy styles for colors pre v1.0.0
79
blackBG: [40, 49],
package-lock.json
package.json
@@ -1,7 +1,7 @@
{
"name": "colors",
"description": "get colors in your node.js console",
- "version": "1.3.4",
+ "version": "1.4.0",
"author": "Marak Squires",
"contributors": [
tests/basic-test.js
@@ -16,7 +16,10 @@ function aE(s, color, code) {
16
}
17
18
var stylesColors = ['white', 'black', 'blue', 'cyan', 'green', 'magenta',
19
- 'red', 'yellow'];
+ 'red', 'yellow', 'brightYellow', 'brightRed',
20
+ 'brightGreen', 'brightBlue', 'brightWhite', 'brightCyan',
21
+ 'brightMagenta'];
22
23
// eslint-disable-next-line
24
var stylesAll = stylesColors.concat(['bold', 'italic', 'underline',
25
'inverse', 'rainbow']);
@@ -46,6 +49,14 @@ aE(s, 'magenta', 35);
46
aE(s, 'red', 31);
47
aE(s, 'yellow', 33);
+aE(s, 'brightWhite', 97);
+aE(s, 'brightBlue', 94);
+aE(s, 'brightCyan', 96);
+aE(s, 'brightGreen', 92);
+aE(s, 'brightMagenta', 95);
+aE(s, 'brightRed', 91);
+aE(s, 'brightYellow', 93);
assert.equal(s, 'string');
var testStringWithNewLines = s + '\n' + s;
tests/safe-test.js
@@ -13,7 +13,9 @@ function aE(s, color, code) {
13
14
15
var stylesAll = stylesColors.concat(['bold', 'italic', 'underline', 'inverse',
'rainbow']);
@@ -37,6 +39,14 @@ aE(s, 'magenta', 35);
45
0 commit comments