Release package version 0.0.3
Update types of scene, added utils for check fill type.
This commit is contained in:
parent
eea082fbd2
commit
f106226e70
13 changed files with 126 additions and 38 deletions
40
lib/src/interfaces/fill.ts
Normal file
40
lib/src/interfaces/fill.ts
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import { IRgbColor } from "./color";
|
||||
import { IPoint } from "@gxc-solutions/math";
|
||||
|
||||
export type FillType = "solid" | "texture";
|
||||
export type GradientType = "liner" | "radial" | "conic";
|
||||
|
||||
export interface IBaseFill {
|
||||
type: GradientType | FillType;
|
||||
}
|
||||
|
||||
export interface ISolidFill extends IBaseFill {
|
||||
type: "solid";
|
||||
color: IRgbColor;
|
||||
}
|
||||
|
||||
export interface ITextureFill extends IBaseFill {
|
||||
type: "texture";
|
||||
texture: HTMLImageElement;
|
||||
}
|
||||
|
||||
export interface IGradientStop {
|
||||
offset: number;
|
||||
color: IRgbColor;
|
||||
}
|
||||
|
||||
export interface ILinerGradient extends IBaseFill {
|
||||
type: "liner";
|
||||
start: IPoint;
|
||||
end: IPoint;
|
||||
stops: IGradientStop[];
|
||||
}
|
||||
|
||||
export interface IRadialGradient {
|
||||
type: "radial";
|
||||
}
|
||||
|
||||
export interface IConicGradient {
|
||||
type: "conic";
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue