summaryrefslogtreecommitdiff
path: root/lib/screens/random.js
diff options
context:
space:
mode:
authorRubén Beltran del Río <ben@nsovocal.com>2018-06-26 22:00:10 +0000
committerRubén Beltran del Río <ben@nsovocal.com>2018-06-26 22:00:10 +0000
commitc80b2f4575cfc3d74ec8e0b112943cbd081ffcd7 (patch)
tree4d2c7a991fcc6510431af72225f7cea2c450f86a /lib/screens/random.js
parentbe12c97f83026087e0974fc54508b09c3154c9eb (diff)
parentfd38d4096e65ba5afba8ed1ddc75ed1814ca8c16 (diff)
Merge branch 'feature/rbdr-update-docs' into 'master'
Update Documentation See merge request rbdr/tomato-sauce!1
Diffstat (limited to 'lib/screens/random.js')
-rw-r--r--lib/screens/random.js22
1 files changed, 13 insertions, 9 deletions
diff --git a/lib/screens/random.js b/lib/screens/random.js
index 6ac706f..0cacea7 100644
--- a/lib/screens/random.js
+++ b/lib/screens/random.js
@@ -1,14 +1,20 @@
'use strict';
-// random colors
-const Random = function (modulation, width, height, renderer) {
+/**
+ * Draws random colors
+ *
+ * @function RandomScreen
+ * @implements IScreen
+ */
+module.exports = 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);
+ for (let i = 0; i < height; ++i) {
+ for (let j = 0; j < width; ++j) {
+ const red = Math.floor(Math.random() * 255);
+ const blue = Math.floor(Math.random() * 255);
+ const green = Math.floor(Math.random() * 255);
response = response + renderer(red, blue, green);
response = response + ' ';
@@ -21,5 +27,3 @@ const Random = function (modulation, width, height, renderer) {
return response;
};
-
-module.exports = Random;