]>
git.r.bdr.sh - rbdr/tomato-sauce/blob - lib/screens/gradients.js
3 // Draws moving gradient boxes.
4 const Gradients = function (modulation
, width
, height
, renderer
) {
7 for (let i
= 0; i
< height
; i
++) {
8 for (let j
= 0; j
< width
; j
++) {
9 let red
= ((modulation
+ i
) * 255 / height
) % 255;
10 let blue
= ((modulation
+ j
) * 255 / width
) % 255;
11 let green
= ((modulation
+ i
* j
) * 255 / (width
* height
)) % 255;
13 response
= response
+ renderer(red
, blue
, green
);
14 response
= response
+ ' ';
18 response
= response
+ '\n';
25 module
.exports
= Gradients
;