We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 56f2418 commit f54b689Copy full SHA for f54b689
src/shapes/shape.ts
@@ -97,7 +97,7 @@ export function stringProperty(...args) {
97
export function colorProperty(target: any, k?, desc?: PropertyDescriptor): any;
98
export function colorProperty(options: ShapePropertyOptions): (target: any, k?, desc?: PropertyDescriptor) => any;
99
export function colorProperty(...args) {
100
- return shapeProperty((v) => (v ? new Color(v) : null), args);
+ return shapeProperty((v) => (v instanceof Color ? v : v ? new Color(v) : null), args);
101
}
102
export function lengthProperty(target: any, k?, desc?: PropertyDescriptor): any;
103
export function lengthProperty(options: ShapePropertyOptions): (target: any, k?, desc?: PropertyDescriptor) => any;
0 commit comments