auto modeling

This commit is contained in:
pengfei.zhou
2019-07-16 15:30:46 +08:00
parent b76851e044
commit d255c05aef
4 changed files with 38 additions and 10 deletions

View File

@@ -1,7 +1,10 @@
import { Modeling } from "./types";
/**
* Store color as format AARRGGBB or RRGGBB
*/
export class Color {
export class Color implements Modeling {
static TRANSPARENT = new Color(0)
_value: number = 0
@@ -32,7 +35,8 @@ export class Color {
return color
}
}
toNumber() {
toModel() {
return this._value
}
}

View File

@@ -18,3 +18,9 @@ export function Property(target: IWatcher, propKey: string) {
}
})
}
export interface Modeling {
toModel(): Model
}
export type Model = string | number | boolean | Modeling | { [index: string]: Model | undefined }