39 lines
753 B
TypeScript
39 lines
753 B
TypeScript
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";
|
|
}
|