Skip to content

Commit f54b689

Browse files
committed
fix: color properties to handle Color
1 parent 56f2418 commit f54b689

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/shapes/shape.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export function stringProperty(...args) {
9797
export function colorProperty(target: any, k?, desc?: PropertyDescriptor): any;
9898
export function colorProperty(options: ShapePropertyOptions): (target: any, k?, desc?: PropertyDescriptor) => any;
9999
export function colorProperty(...args) {
100-
return shapeProperty((v) => (v ? new Color(v) : null), args);
100+
return shapeProperty((v) => (v instanceof Color ? v : v ? new Color(v) : null), args);
101101
}
102102
export function lengthProperty(target: any, k?, desc?: PropertyDescriptor): any;
103103
export function lengthProperty(options: ShapePropertyOptions): (target: any, k?, desc?: PropertyDescriptor) => any;

0 commit comments

Comments
 (0)