summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/colors/lib/maps/rainbow.js
blob: 5442744369524829219db2384bc91664a6161bdd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
var colors = require('../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);
    }
  };
})();