diff options
Diffstat (limited to 'deps/npm/node_modules/colors/lib/maps/rainbow.js')
-rw-r--r-- | deps/npm/node_modules/colors/lib/maps/rainbow.js | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/deps/npm/node_modules/colors/lib/maps/rainbow.js b/deps/npm/node_modules/colors/lib/maps/rainbow.js index 5442744369..874508da8e 100644 --- a/deps/npm/node_modules/colors/lib/maps/rainbow.js +++ b/deps/npm/node_modules/colors/lib/maps/rainbow.js @@ -1,12 +1,11 @@ -var colors = require('../colors'); - -module['exports'] = (function () { - var rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta']; //RoY G BiV - return function (letter, i, exploded) { - if (letter === " ") { +module['exports'] = function(colors) { + // RoY G BiV + var rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta']; + return function(letter, i, exploded) { + if (letter === ' ') { return letter; } else { return colors[rainbowColors[i++ % rainbowColors.length]](letter); } }; -})(); +}; |