Websocket
[VSoRC/.git] / node_modules / node-static / node_modules / colors / lib / maps / random.js
diff --git a/node_modules/node-static/node_modules/colors/lib/maps/random.js b/node_modules/node-static/node_modules/colors/lib/maps/random.js
new file mode 100644 (file)
index 0000000..3d82a39
--- /dev/null
@@ -0,0 +1,11 @@
+module['exports'] = function(colors) {
+  var available = ['underline', 'inverse', 'grey', 'yellow', 'red', 'green',
+    'blue', 'white', 'cyan', 'magenta', 'brightYellow', 'brightRed',
+    'brightGreen', 'brightBlue', 'brightWhite', 'brightCyan', 'brightMagenta'];
+  return function(letter, i, exploded) {
+    return letter === ' ' ? letter :
+      colors[
+          available[Math.round(Math.random() * (available.length - 2))]
+      ](letter);
+  };
+};