4 <meta http-equiv="Content-type" content="text/html; charset=utf-8">
5 <title>Colors Example</title>
6 <script src="colors.js"></script>
11 var test = colors.red("hopefully colorless output");
13 document.write('Rainbows are fun!'.rainbow + '<br/>');
14 document.write('So '.italic + 'are'.underline + ' styles! '.bold + 'inverse'.inverse); // styles not widely supported
15 document.write('Chains are also cool.'.bold.italic.underline.red); // styles not widely supported
16 //document.write('zalgo time!'.zalgo);
17 document.write(test.stripColors);
18 document.write("a".grey + " b".black);
20 document.write("Zebras are so fun!".zebra);
22 document.write(colors.rainbow('Rainbows are fun!'));
23 document.write("This is " + "not".strikethrough + " fun.");
25 document.write(colors.italic('So ') + colors.underline('are') + colors.bold(' styles! ') + colors.inverse('inverse')); // styles not widely supported
26 document.write(colors.bold(colors.italic(colors.underline(colors.red('Chains are also cool.'))))); // styles not widely supported
27 //document.write(colors.zalgo('zalgo time!'));
28 document.write(colors.stripColors(test));
29 document.write(colors.grey("a") + colors.black(" b"));
31 colors.addSequencer("america", function(letter, i, exploded) {
32 if(letter === " ") return letter;
34 case 0: return letter.red;
35 case 1: return letter.white;
36 case 2: return letter.blue;
40 colors.addSequencer("random", (function() {
41 var available = ['bold', 'underline', 'italic', 'inverse', 'grey', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta'];
43 return function(letter, i, exploded) {
44 return letter === " " ? letter : letter[available[Math.round(Math.random() * (available.length - 1))]];
48 document.write("AMERICA! F--K YEAH!".america);
49 document.write("So apparently I've been to Mars, with all the little green men. But you know, I don't recall.".random);
69 document.write("this is an error".error);
71 // outputs yellow text
72 document.write("this is a warning".warn);