]> git.r.bdr.sh - rbdr/tomato-sauce/blobdiff - lib/screens/gradients.js
Update Documentation
[rbdr/tomato-sauce] / lib / screens / gradients.js
index 5e63d5ba9e567c1aec5ca690a20cba8263749883..2d4a2f0b4458b3bf8c05efe7670a575802d812f2 100644 (file)
@@ -1,14 +1,20 @@
 'use strict';
 
-// Draws moving gradient boxes.
-const Gradients = function (modulation, width, height, renderer) {
+/**
+ * Draws moving gradient boxes
+ *
+ * @function GradientsScreen
+ * @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 = ((modulation + i) * 255 / height) % 255;
-      let blue = ((modulation + j) * 255 / width) % 255;
-      let green = ((modulation + i * j) * 255 / (width * height)) % 255;
+  for (let i = 0; i < height; ++i) {
+    for (let j = 0; j < width; ++j) {
+      const red = ((modulation + i) * 255 / height) % 255;
+      const blue = ((modulation + j) * 255 / width) % 255;
+      const green = ((modulation + i * j) * 255 / (width * height)) % 255;
 
       response = response + renderer(red, blue, green);
       response = response + ' ';
@@ -21,5 +27,3 @@ const Gradients = function (modulation, width, height, renderer) {
 
   return response;
 };
-
-module.exports = Gradients;