auto modeling
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
@@ -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 }
|
Reference in New Issue
Block a user