+36
-0
@@ -151,2 +151,38 @@ // Import. | ||
| } | ||
| /** | ||
| * Bright style. | ||
| * @param {string} text - Text. | ||
| * @return {string} | ||
| */ | ||
| static brightStyle(text = '') { | ||
| return setColor(text, colors.style.bright); | ||
| } | ||
| /** | ||
| * Dim style. | ||
| * @param {string} text - Text. | ||
| * @return {string} | ||
| */ | ||
| static dimStyle(text = '') { | ||
| return setColor(text, colors.style.dim); | ||
| } | ||
| /** | ||
| * Underscore style. | ||
| * @param {string} text - Text. | ||
| * @return {string} | ||
| */ | ||
| static underscoreStyle(text = '') { | ||
| return setColor(text, colors.style.underscore); | ||
| } | ||
| /** | ||
| * Blink style. | ||
| * @param {string} text - Text. | ||
| * @return {string} | ||
| */ | ||
| static blinkStyle(text = '') { | ||
| return setColor(text, colors.style.blink); | ||
| } | ||
| } | ||
@@ -153,0 +189,0 @@ |
+6
-0
@@ -25,3 +25,9 @@ /** | ||
| cyan: '\x1b[46m' | ||
| }, | ||
| style: { | ||
| bright: '\x1b[1m', | ||
| dim: '\x1b[2m', | ||
| underscore: '\x1b[4m', | ||
| blink: '\x1b[5m' | ||
| } | ||
| }; |
+1
-1
| { | ||
| "name": "ccolor", | ||
| "version": "1.1.1", | ||
| "version": "1.2.1", | ||
| "description": "Console color", | ||
@@ -5,0 +5,0 @@ "main": "app.js", |
+6
-0
@@ -43,2 +43,8 @@ # CColor | ||
| // Styles. | ||
| console.log(CColor.brightStyle('Bright style.')); | ||
| console.log(CColor.dimStyle('Dim style.')); | ||
| console.log(CColor.underscoreStyle('Underscore style.')); | ||
| console.log(CColor.blinkStyle('Blink style.')); | ||
| // Colored foreground and backgrounds at the same time. | ||
@@ -45,0 +51,0 @@ console.log(CColor.yellowBackground(CColor.red('Red foreground with yellow background.'))); |
+8
-0
@@ -28,2 +28,10 @@ // Import. | ||
| // Test styles. | ||
| console.log('\nStyles:'); | ||
| console.log('--------------'); | ||
| console.log(CColor.brightStyle('Bright style.')); | ||
| console.log(CColor.dimStyle('Dim style.')); | ||
| console.log(CColor.underscoreStyle('Underscore style.')); | ||
| console.log(CColor.blinkStyle('Blink style.')); | ||
| // Test mixed. | ||
@@ -30,0 +38,0 @@ console.log('\nMixed:'); |
9487
15.72%244
22.61%64
10.34%