Skip to content

Commit

Permalink
fixed(display): Resolved alpha blending issues for colors defined as …
Browse files Browse the repository at this point in the history
…RGBA arrays.

Signed-off-by: Tim Deubler <[email protected]>
  • Loading branch information
TerminalTim committed Jul 8, 2024
1 parent 98c6395 commit e35b421
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/display/src/displays/webgl/buffer/FeatureFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ export class FeatureFactory {
}

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

0 comments on commit e35b421

Please sign in to comment.