Release package version 0.0.3
Some checks failed
CI / build (push) Failing after 13s
CI / deploy (push) Has been skipped

Update types of scene, added utils for check fill type.
This commit is contained in:
Andrey Kernichniy 2026-03-07 00:16:34 +07:00
parent eea082fbd2
commit f106226e70
13 changed files with 126 additions and 38 deletions

View 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";
}