add rainbow example

This commit is contained in:
Josh Junon 2017-06-29 16:00:51 -07:00
parent 09fb2d8606
commit c0155688cf
2 changed files with 42 additions and 2 deletions

View file

@ -1,17 +0,0 @@
'use strict';
const chalk = require('.');
// Generates screenshot
for (const key of Object.keys(chalk.styles)) {
let ret = key;
if (key === 'reset' || key === 'hidden' || key === 'grey') {
continue;
}
if (/^bg[^B]/.test(key)) {
ret = chalk.black(ret);
}
process.stdout.write(chalk[key](ret) + ' ');
}