Comparing version 0.1.3 to 0.1.4
'use strict'; | ||
var map = require('es5-ext/lib/Object/plain/map').call | ||
var defineProperties = Object.defineProperties | ||
, map = require('es5-ext/lib/Object/plain/map').call | ||
@@ -28,2 +29,3 @@ , toString, codes, properties, init; | ||
); | ||
codes.gray = [90, 39]; | ||
@@ -39,6 +41,24 @@ properties = map(codes, function (code) { | ||
}); | ||
properties.bright = { | ||
get: function () { | ||
this._bright = true; | ||
return this; | ||
}, | ||
enumerable: true | ||
}; | ||
properties.bgBright = { | ||
get: function () { | ||
this._bgBright = true; | ||
return this; | ||
}, | ||
enumerable: true | ||
}; | ||
init = function () { | ||
var o = Object.defineProperties(function self (msg) { | ||
var o = defineProperties(function self (msg) { | ||
return self.style.reduce(function (msg, code) { | ||
if ((self._bright && (code[0] >= 30) && (code[0] < 38)) || | ||
(self._bgBright && (code[0] >= 40) && (code[0] < 48))) { | ||
code = [code[0]+60, code[1]]; | ||
} | ||
return toString(code, msg); | ||
@@ -51,5 +71,5 @@ }, msg); | ||
module.exports = Object.defineProperties(function (msg) { | ||
module.exports = defineProperties(function (msg) { | ||
return msg; | ||
}, map(codes, function (code, name) { | ||
}, map(properties, function (code, name) { | ||
return { | ||
@@ -56,0 +76,0 @@ get: init.bind(name), |
{ | ||
"name": "cli-color", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Colors, formatting and other tools for the console", | ||
@@ -5,0 +5,0 @@ "keywords": ["ansi", "color", "console", "terminal", "cli", "shell", "log", "logging", "xterm"], |
@@ -60,2 +60,3 @@ # cli-color - Yet another colors and formatting for the console solution | ||
* white | ||
* gray (technically bright.black) | ||
@@ -73,3 +74,9 @@ #### Background colors | ||
#### Colors intensity | ||
For _bright_ color variants: | ||
* bright (foreground) | ||
* bgBright (background) | ||
### Additional functions: | ||
@@ -76,0 +83,0 @@ |
Sorry, the diff of this file is not supported yet
8665
222
107