]> git.r.bdr.sh - rbdr/tomato-sauce/blobdiff - lib/screens/random.js
Update Documentation
[rbdr/tomato-sauce] / lib / screens / random.js
index 6ac706f039ddc5720050a2750373615c2a151073..0cacea7c20a5bd439206c2c2e931e3d00f5e7059 100644 (file)
@@ -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;