aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2024-11-12 18:54:06 +0200
committerkaotisk <kaotisk@arching-kaos.org>2024-11-12 18:54:06 +0200
commitf64f29667e7aa0f6a861ae0ca975e068db36eb8d (patch)
tree5b5a14d452e2f20fa1dbfc54cabb0147a409e3d7
parentf10d899d26c19c15124b3a3b2a6a7a82f3708396 (diff)
downloadarching-kaos-radio-f64f29667e7aa0f6a861ae0ca975e068db36eb8d.tar.gz
arching-kaos-radio-f64f29667e7aa0f6a861ae0ca975e068db36eb8d.tar.bz2
arching-kaos-radio-f64f29667e7aa0f6a861ae0ca975e068db36eb8d.zip
Changed way of render the picture
-rw-r--r--client/js/image_generator.js25
1 files changed, 14 insertions, 11 deletions
diff --git a/client/js/image_generator.js b/client/js/image_generator.js
index bf248c8..81169e1 100644
--- a/client/js/image_generator.js
+++ b/client/js/image_generator.js
@@ -42,8 +42,8 @@ function generateImage(hash, what)
}
else
{
- // pixel = `#${r1}${r2}${g1}${g2}${b1}${b2}`;
- pixel = `#${r1}${r2}${g1}${g2}${b1}${b2}${t1}${t2}`;
+ pixel = `#${r1}${r2}${g1}${g2}${b1}${b2}`;
+ //pixel = `#${r1}${r2}${g1}${g2}${b1}${b2}${t1}${t2}`;
//pixel = `#${r1}${r1}${r1}${r1}${r1}${r1}${r1}${r1}`;
//pixel = `#${r1}${r1}${r1}${r1}${r1}${r1}`;
//pixel = `#${r1}${g1}${b1}`;
@@ -115,15 +115,18 @@ function createImage(pixels, hash, what)
for (var k = 0; k < radius; ++k)
{
var subpixel = pixel_to_be_enhanced;
- // if ( i > radius - Math.floor(radius/2) )
- // {
- // debugLog(i);
- // }
- c = (x*radius)+k;
- r = (y*radius)+i;
- context.fillStyle = subpixel;
- context.fillRect(c, r, radius, radius);
- context.stroke();
+ if ( i >= radius - Math.floor(radius/2) )
+ {
+ if ( k >= radius - Math.floor(radius/2) )
+ {
+ // debugLog(i);
+ c = (x*radius)+k;
+ r = (y*radius)+i;
+ context.fillStyle = subpixel;
+ context.fillRect(c, r, radius/3, radius/3);
+ context.stroke();
+ }
+ }
//debugLog(`${x} -> ${c}, ${y} -> ${r}`);
}
}