aboutsummaryrefslogtreecommitdiff
path: root/node_modules/colors/lib/maps
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/colors/lib/maps')
-rw-r--r--node_modules/colors/lib/maps/america.js12
-rw-r--r--node_modules/colors/lib/maps/rainbow.js13
-rw-r--r--node_modules/colors/lib/maps/random.js8
-rw-r--r--node_modules/colors/lib/maps/zebra.js5
4 files changed, 38 insertions, 0 deletions
diff --git a/node_modules/colors/lib/maps/america.js b/node_modules/colors/lib/maps/america.js
new file mode 100644
index 00000000..a07d8327
--- /dev/null
+++ b/node_modules/colors/lib/maps/america.js
@@ -0,0 +1,12 @@
+var colors = require('../colors');
+
+module['exports'] = (function() {
+ return function (letter, i, exploded) {
+ if(letter === " ") return letter;
+ switch(i%3) {
+ case 0: return colors.red(letter);
+ case 1: return colors.white(letter)
+ case 2: return colors.blue(letter)
+ }
+ }
+})(); \ No newline at end of file
diff --git a/node_modules/colors/lib/maps/rainbow.js b/node_modules/colors/lib/maps/rainbow.js
new file mode 100644
index 00000000..a7ce24e6
--- /dev/null
+++ b/node_modules/colors/lib/maps/rainbow.js
@@ -0,0 +1,13 @@
+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);
+ }
+ };
+})();
+
diff --git a/node_modules/colors/lib/maps/random.js b/node_modules/colors/lib/maps/random.js
new file mode 100644
index 00000000..5cd101fa
--- /dev/null
+++ b/node_modules/colors/lib/maps/random.js
@@ -0,0 +1,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);
+ };
+})(); \ No newline at end of file
diff --git a/node_modules/colors/lib/maps/zebra.js b/node_modules/colors/lib/maps/zebra.js
new file mode 100644
index 00000000..bf7dcdea
--- /dev/null
+++ b/node_modules/colors/lib/maps/zebra.js
@@ -0,0 +1,5 @@
+var colors = require('../colors');
+
+module['exports'] = function (letter, i, exploded) {
+ return i % 2 === 0 ? letter : colors.inverse(letter);
+}; \ No newline at end of file