diff --git a/README.md b/README.md index 1d784da6..fabe5589 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,16 @@ Please check out the [roadmap](ROADMAP.md) for upcoming features and releases. - gray - grey +### bright text colors + + - brightRed + - brightGreen + - brightYellow + - brightBlue + - brightMagenta + - brightCyan + - brightWhite + ### background colors - bgBlack @@ -39,6 +49,18 @@ Please check out the [roadmap](ROADMAP.md) for upcoming features and releases. - bgMagenta - bgCyan - bgWhite + - bgGray + - bgGrey + +### bright background colors + + - bgBrightRed + - bgBrightGreen + - bgBrightYellow + - bgBrightBlue + - bgBrightMagenta + - bgBrightCyan + - bgBrightWhite ### styles diff --git a/examples/normal-usage.js b/examples/normal-usage.js index cc8d05ff..822db1cc 100644 --- a/examples/normal-usage.js +++ b/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'); diff --git a/examples/safe-string.js b/examples/safe-string.js index 98994873..5bc0168e 100644 --- a/examples/safe-string.js +++ b/examples/safe-string.js @@ -28,6 +28,8 @@ console.log(colors.black.bgWhite('Background color attack!')); 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?!')); + console.log('Setting themes is useful'); // diff --git a/lib/maps/random.js b/lib/maps/random.js index 6f8f2f8e..3d82a39e 100644 --- a/lib/maps/random.js +++ b/lib/maps/random.js @@ -1,6 +1,7 @@ module['exports'] = function(colors) { var available = ['underline', 'inverse', 'grey', 'yellow', 'red', 'green', - 'blue', 'white', 'cyan', 'magenta']; + 'blue', 'white', 'cyan', 'magenta', 'brightYellow', 'brightRed', + 'brightGreen', 'brightBlue', 'brightWhite', 'brightCyan', 'brightMagenta']; return function(letter, i, exploded) { return letter === ' ' ? letter : colors[ diff --git a/lib/styles.js b/lib/styles.js index 02db9acf..011dafd8 100644 --- a/lib/styles.js +++ b/lib/styles.js @@ -48,6 +48,14 @@ var codes = { 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], + bgGray: [100, 49], + bgGrey: [100, 49], + + bgBrightRed: [101, 49], + bgBrightGreen: [102, 49], + bgBrightYellow: [103, 49], + bgBrightBlue: [104, 49], + bgBrightMagenta: [105, 49], + bgBrightCyan: [106, 49], + bgBrightWhite: [107, 49], // legacy styles for colors pre v1.0.0 blackBG: [40, 49], diff --git a/package-lock.json b/package-lock.json index 9986b6ae..8570ee68 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "colors", - "version": "1.3.4", + "version": "1.4.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 30e1a717..dbd71ba5 100644 --- a/package.json +++ b/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": [ { diff --git a/tests/basic-test.js b/tests/basic-test.js index 11c21c88..9713e50e 100644 --- a/tests/basic-test.js +++ b/tests/basic-test.js @@ -16,7 +16,10 @@ function aE(s, color, code) { } var stylesColors = ['white', 'black', 'blue', 'cyan', 'green', 'magenta', - 'red', 'yellow']; + 'red', 'yellow', 'brightYellow', 'brightRed', + 'brightGreen', 'brightBlue', 'brightWhite', 'brightCyan', + 'brightMagenta']; + // eslint-disable-next-line var stylesAll = stylesColors.concat(['bold', 'italic', 'underline', 'inverse', 'rainbow']); @@ -46,6 +49,14 @@ aE(s, 'magenta', 35); aE(s, 'red', 31); 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; diff --git a/tests/safe-test.js b/tests/safe-test.js index 95a21b7e..ce09b029 100644 --- a/tests/safe-test.js +++ b/tests/safe-test.js @@ -13,7 +13,9 @@ function aE(s, color, code) { } var stylesColors = ['white', 'black', 'blue', 'cyan', 'green', 'magenta', - 'red', 'yellow']; + 'red', 'yellow', 'brightYellow', 'brightRed', + 'brightGreen', 'brightBlue', 'brightWhite', 'brightCyan', + 'brightMagenta']; // eslint-disable-next-line var stylesAll = stylesColors.concat(['bold', 'italic', 'underline', 'inverse', 'rainbow']); @@ -37,6 +39,14 @@ aE(s, 'magenta', 35); aE(s, 'red', 31); 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;