package.src.graphic.Gradient.ts Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zrender Show documentation
Show all versions of zrender Show documentation
A lightweight graphic library providing 2d draw for Apache ECharts
The newest version!
// TODO Should GradientObject been LinearGradientObject | RadialGradientObject
export interface GradientObject {
id?: number
type: string
colorStops: GradientColorStop[]
global?: boolean
}
export interface InnerGradientObject extends GradientObject {
__canvasGradient: CanvasGradient
__width: number
__height: number
}
export interface GradientColorStop {
offset: number
color: string
}
export default class Gradient {
id?: number
type: string
colorStops: GradientColorStop[]
global: boolean
constructor(colorStops: GradientColorStop[]) {
this.colorStops = colorStops || [];
}
addColorStop(offset: number, color: string) {
this.colorStops.push({
offset,
color
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy