Fix grid overlay color showing as none

This commit is contained in:
Keavon Chambers
2024-07-27 17:25:33 -07:00
parent d6dad92659
commit a4a513911d
4 changed files with 9 additions and 5 deletions
@@ -812,6 +812,7 @@ export class CheckboxInput extends WidgetProps {
export class ColorButton extends WidgetProps {
@Transform(({ value }) => {
if (value instanceof Gradient) return value;
const gradient = value["Gradient"];
if (gradient) {
const stops = gradient.map(([position, color]: [number, color: { red: number; green: number; blue: number; alpha: number }]) => ({
@@ -821,6 +822,7 @@ export class ColorButton extends WidgetProps {
return new Gradient(stops);
}
if (value instanceof Color) return value;
const solid = value["Solid"];
if (solid) {
return new Color(solid.red, solid.green, solid.blue, solid.alpha);