Skip to content

Commit

Permalink
refactor and simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
Elijbet committed Feb 8, 2024
1 parent fb37c29 commit 2a5b1b8
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1408,7 +1408,7 @@ export class ColorPicker

const pattern = context.createPattern(this.getCheckeredBackgroundPattern(), "repeat");

if (color.alpha() < 1) {
if (color.alpha() < 1 && applyAlpha) {
context.beginPath();
context.arc(x, y, radius - 3, startAngle, endAngle);
context.fillStyle = pattern;
Expand All @@ -1419,9 +1419,8 @@ export class ColorPicker

context.beginPath();
context.arc(x, y, radius - 3, startAngle, endAngle);
applyAlpha
? (context.fillStyle = color.rgb().alpha(color.alpha()).string())
: (context.fillStyle = color.rgb().alpha(1).string());
const alpha = applyAlpha ? color.alpha() : 1;
context.fillStyle = color.rgb().alpha(alpha).string();
context.fill();

context.globalCompositeOperation = "source-over";
Expand Down

0 comments on commit 2a5b1b8

Please sign in to comment.