aboutsummaryrefslogtreecommitdiff
path: root/node_modules/colors/lib/maps
diff options
context:
space:
mode:
authorruki <waruqi@gmail.com>2018-11-08 00:38:48 +0800
committerruki <waruqi@gmail.com>2018-11-07 21:53:09 +0800
commit26105034da4fcce7ac883c899d781f016559310d (patch)
treec459a5dc4e3aa0972d9919033ece511ce76dd129 /node_modules/colors/lib/maps
parent2c77f00f1a7ecb6c8192f9c16d3b2001b254a107 (diff)
downloadxmake-docs-26105034da4fcce7ac883c899d781f016559310d.tar.gz
xmake-docs-26105034da4fcce7ac883c899d781f016559310d.zip
switch to vuepress
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