Websocket
[VSoRC/.git] / node_modules / node-static / node_modules / colors / lib / maps / rainbow.js
diff --git a/node_modules/node-static/node_modules/colors/lib/maps/rainbow.js b/node_modules/node-static/node_modules/colors/lib/maps/rainbow.js
new file mode 100644 (file)
index 0000000..2b00ac0
--- /dev/null
@@ -0,0 +1,12 @@
+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);
+    }
+  };
+};
+