Skip to content

Commit 1ba649f

Browse files
committed
Added compatibility fix so that color refactor doesnt break current WebGL behaviour
1 parent 265f9e7 commit 1ba649f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/color/p5.Color.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,10 @@ p5.Color = class Color {
488488
return to(this.color, 'hsl').coords[2] / 100 * this.maxes[this.mode][2];
489489
}
490490
}
491+
492+
get levels() {
493+
return [...this.color.coords, this.color.alpha].map(v => v * 255);
494+
}
491495
};
492496

493497
export default p5.Color;

0 commit comments

Comments
 (0)