Adds 256 color support.

This commit is contained in:
Joshua Appelman 2014-07-14 00:23:49 +02:00
parent 03b92b1bb8
commit 79c6bdcfd8
3 changed files with 21 additions and 0 deletions

11
test.js
View file

@ -86,3 +86,14 @@ describe('chalk.stripColor()', function () {
assert.equal(chalk.stripColor(chalk.underline.red.bgGreen('foo')), 'foo');
});
});
describe('chalk.foreground() and chalk.background()', function () {
it('should style according to their given rgb values', function () {
assert.equal(chalk.foreground(2, 5, 3, 'foobar'), '\u001b[;38;5;121mfoobar\u001b[0m');
});
it('should play nice with other chalk styles', function () {
assert.equal(chalk.background(1, 3, 3, chalk.red("Unicorns, attack!")), '\u001b[;48;5;73m\u001b[31mUnicorns, attack!\u001b[39m\u001b[0m');
});
});