summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/colors/lib/maps/random.js
blob: 5cd101fae2b3dcab3c6354e82ae9763dc9c9232b (plain)
1
2
3
4
5
6
7
8
var colors = require('../colors');

module['exports'] = (function () {
  var available = ['underline', 'inverse', 'grey', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta'];
  return function(letter, i, exploded) {
    return letter === " " ? letter : colors[available[Math.round(Math.random() * (available.length - 1))]](letter);
  };
})();