Comparing version 2.0.0 to 2.0.1
@@ -76,2 +76,33 @@ | ||
exports.color.grey = exports.color.gray = exports.grey = exports.gray = function(text) { | ||
if (!terminal.isColorSupported()) return text; | ||
if (terminal.is256ColorSupported()) { | ||
return '\x1b[38;5;8m' + text + '\x1b[0m'; | ||
} | ||
return '\x1b[30;1m' + text + '\x1b[0m'; | ||
}; | ||
Object.defineProperty(Color.prototype, 'gray', { | ||
get: function() { | ||
if (terminal.isColorSupported) { | ||
this.fgcolor = 8; | ||
} else { | ||
this.styles = this.styles.concat(1); | ||
this.fgcolor = 0; | ||
} | ||
return this; | ||
} | ||
}); | ||
Object.defineProperty(Color.prototype, 'grey', { | ||
get: function() { | ||
if (terminal.isColorSupported) { | ||
this.fgcolor = 8; | ||
} else { | ||
this.styles = this.styles.concat(1); | ||
this.fgcolor = 0; | ||
} | ||
return this; | ||
} | ||
}); | ||
Color.prototype.valueOf = function() { | ||
@@ -78,0 +109,0 @@ if (!terminal.isColorSupported()) return this.string; |
{ | ||
"name": "colorful", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "colorful if a terminal tool for colors", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -108,9 +108,11 @@ # Colorful | ||
- gray | ||
- grey_bg | ||
- gray_bg | ||
# Changelog | ||
## `2.0.0` | ||
## 2013-03-18 `2.0.1` | ||
Add gray color. | ||
## 2013-03-18 `2.0.0` | ||
Redesign. Support for ANSI 256 colors. | ||
@@ -120,2 +122,2 @@ | ||
- removed logging | ||
- remove logging |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
9052
192
122
0