random.js 352 B

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