1 var colors = require('./colors');
3 //colors.mode = "browser";
5 var test = colors.red("hopefully colorless output");
6 console.log('Rainbows are fun!'.rainbow);
7 console.log('So '.italic + 'are'.underline + ' styles! '.bold + 'inverse'.inverse); // styles not widely supported
8 console.log('Chains are also cool.'.bold.italic.underline.red); // styles not widely supported
9 //console.log('zalgo time!'.zalgo);
10 console.log(test.stripColors);
11 console.log("a".grey + " b".black);
12 console.log("Zebras are so fun!".zebra);
13 console.log('background color attack!'.black.whiteBG)
16 // Remark: .strikethrough may not work with Mac OS Terminal App
18 console.log("This is " + "not".strikethrough + " fun.");
19 console.log(colors.rainbow('Rainbows are fun!'));
20 console.log(colors.italic('So ') + colors.underline('are') + colors.bold(' styles! ') + colors.inverse('inverse')); // styles not widely supported
21 console.log(colors.bold(colors.italic(colors.underline(colors.red('Chains are also cool.'))))); // styles not widely supported
22 //console.log(colors.zalgo('zalgo time!'));
23 console.log(colors.stripColors(test));
24 console.log(colors.grey("a") + colors.black(" b"));
26 colors.addSequencer("america", function(letter, i, exploded) {
27 if(letter === " ") return letter;
29 case 0: return letter.red;
30 case 1: return letter.white;
31 case 2: return letter.blue;
35 colors.addSequencer("random", (function() {
36 var available = ['bold', 'underline', 'italic', 'inverse', 'grey', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta'];
38 return function(letter, i, exploded) {
39 return letter === " " ? letter : letter[available[Math.round(Math.random() * (available.length - 1))]];
43 console.log("AMERICA! F--K YEAH!".america);
44 console.log("So apparently I've been to Mars, with all the little green men. But you know, I don't recall.".random);
50 // Load theme with JSON literal
65 console.log("this is an error".error);
67 // outputs yellow text
68 console.log("this is a warning".warn);
71 console.log("this is an input".input);
73 // Load a theme from file
74 colors.setTheme('./themes/winston-dark.js');
76 console.log("this is an input".input);