diff --git a/js/doc/maps/rainbow.js b/js/doc/maps/rainbow.js new file mode 100644 index 0000000..6a8ba5b --- /dev/null +++ b/js/doc/maps/rainbow.js @@ -0,0 +1,13 @@ +var colors = Require('doc/colors'); + +module['exports'] = (function () { + var rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta']; //RoY G BiV + return function (letter, i, exploded) { + if (letter === " ") { + return letter; + } else { + return colors[rainbowColors[i++ % rainbowColors.length]](letter); + } + }; +})(); +