summaryrefslogtreecommitdiff
path: root/lib/screens/gradients.js
diff options
context:
space:
mode:
authorRuben Beltran del Rio <ruben@unlimited.pizza>2021-12-24 13:54:43 +0100
committerRuben Beltran del Rio <ruben@unlimited.pizza>2021-12-24 13:54:43 +0100
commita0666be3ab58ed83ad6d622cfe2b8293c40dffbb (patch)
treee2688587db986a3bc4b040dce1041dac3b352a80 /lib/screens/gradients.js
parentc80b2f4575cfc3d74ec8e0b112943cbd081ffcd7 (diff)
Update code and dpendencies
Diffstat (limited to 'lib/screens/gradients.js')
-rw-r--r--lib/screens/gradients.js26
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/screens/gradients.js b/lib/screens/gradients.js
index 2d4a2f0..9694fc6 100644
--- a/lib/screens/gradients.js
+++ b/lib/screens/gradients.js
@@ -8,22 +8,22 @@
*/
module.exports = function (modulation, width, height, renderer) {
- let response = '';
+ let response = '';
- 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;
+ 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 + ' ';
- }
+ response = response + renderer(red, blue, green);
+ response = response + ' ';
+ }
- if (i < height - 1) {
- response = response + '\n';
+ if (i < height - 1) {
+ response = response + '\n';
+ }
}
- }
- return response;
+ return response;
};