summaryrefslogtreecommitdiff
path: root/lib/screens/random.js
diff options
context:
space:
mode:
authorBen Beltran <ben@nsovocal.com>2016-05-09 00:31:25 -0500
committerBen Beltran <ben@nsovocal.com>2016-05-09 00:31:25 -0500
commita140f3add912ef4bd659c1c1e82184643be7d845 (patch)
tree131f33520cc40abc387474fa9c2ac4f536e6d7d1 /lib/screens/random.js
parentae6dbe43bf54581dd7012f95581d4a1b6ee245f0 (diff)
parent09ab7e985d46cad6d3c89e37f983e286e9fda2f6 (diff)
Merge branch 'feature/the-actual-tomato-sauce' into develop
Diffstat (limited to 'lib/screens/random.js')
-rw-r--r--lib/screens/random.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/screens/random.js b/lib/screens/random.js
new file mode 100644
index 0000000..6ac706f
--- /dev/null
+++ b/lib/screens/random.js
@@ -0,0 +1,25 @@
+'use strict';
+
+// random colors
+const Random = function (modulation, width, height, renderer) {
+ let response = '';
+
+ for (let i = 0; i < height; i++) {
+ for (let j = 0; j < width; j++) {
+ let red = Math.floor(Math.random() * 255);
+ let blue = Math.floor(Math.random() * 255);
+ let green = Math.floor(Math.random() * 255);
+
+ response = response + renderer(red, blue, green);
+ response = response + ' ';
+ }
+
+ if (i < height - 1) {
+ response = response + '\n';
+ }
+ }
+
+ return response;
+};
+
+module.exports = Random;