rgb manipulation optimisation

This commit is contained in:
Sam
2025-12-29 22:29:00 +13:00
parent 2ac6cd2835
commit 8ef9705499
16 changed files with 90 additions and 89 deletions

View File

@@ -5,7 +5,7 @@ class FloralAccident extends BaseShape {
static config = [
{ type: 'range', min: 1, max: 50, defaultValue: 20, property: 'sides' },
{ type: 'range', min: 1, max: 600, defaultValue: 240, property: 'width' },
{ type: 'color', defaultValue: '#4287f5', property: 'colour' },
{ type: 'color', defaultValue: [66, 135, 245], property: 'colour' },
];
constructor(sides, width, colour) {
@@ -36,7 +36,7 @@ class FloralAccident extends BaseShape {
end + rad(n),
0
);
ctx.strokeStyle = this.colour;
ctx.strokeStyle = colourToText(this.colour);
ctx.stroke();
ctx.beginPath();
@@ -48,7 +48,7 @@ class FloralAccident extends BaseShape {
end - (end - stt - rad(rotation)) / 2 + rad(n),
0
);
ctx.strokeStyle = this.colour;
ctx.strokeStyle = colourToText(this.colour);
ctx.stroke();
stt = end + -(rad(rot - piv));