mirror of
https://github.com/flynx/colors.js.git
synced 2025-10-29 19:10:10 +00:00
[api] Added ability to safely require colors without messing with String.prototype [api] Removed browser functionality [dist] Add travis file
12 lines
307 B
JavaScript
12 lines
307 B
JavaScript
var colors = require('../colors');
|
|
|
|
module['exports'] = (function() {
|
|
return function (letter, i, exploded) {
|
|
if(letter === " ") return letter;
|
|
switch(i%3) {
|
|
case 0: return colors.red(letter);
|
|
case 1: return colors.white(letter)
|
|
case 2: return colors.blue(letter)
|
|
}
|
|
}
|
|
})(); |