]>
git.r.bdr.sh - rbdr/tomato-sauce/blob - lib/screens/gradients.js
4 * Draws moving gradient boxes
6 * @function GradientsScreen
9 module
.exports = function (modulation
, width
, height
, renderer
) {
13 for (let i
= 0; i
< height
; ++i
) {
14 for (let j
= 0; j
< width
; ++j
) {
15 const red
= ((modulation
+ i
) * 255 / height
) % 255;
16 const blue
= ((modulation
+ j
) * 255 / width
) % 255;
17 const green
= ((modulation
+ i
* j
) * 255 / (width
* height
)) % 255;
19 response
= response
+ renderer(red
, blue
, green
);
20 response
= response
+ ' ';
24 response
= response
+ '\n';