Skip to content

Commit

Permalink
fix potential issue in case alpha is set to 0 (should not be rendered…
Browse files Browse the repository at this point in the history
… at all)

Signed-off-by: Tim Deubler <[email protected]>
  • Loading branch information
TerminalTim committed Jul 9, 2024
1 parent e35b421 commit 657c1ea
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export class FeatureFactory {

private toRGBA(color: Color, alpha: number = 1, premultiplyAlpha: boolean = true): RGBA {
const rgba = Array.isArray(color)
? [color[0], color[1], color[2], color[3]??1] as RGBA
? [color[0], color[1], color[2], typeof color[3] == 'number' ? color[3] : 1] as RGBA
: toRGB(color);
if (rgba) {
alpha = rgba[3] *= alpha;
Expand Down

0 comments on commit 657c1ea

Please sign in to comment.