I'd like to be able to use a linear gradient as a fill color when generate shapes. However, the TypeScript definition of color in FillOptions is limited to string. How can I go about solving this?
const gradient = new LinearGradient({
name: "LG1",
stops: [
new GradientStop({
color: "gray",
offset: 0,
opacity: 0
}),
new GradientStop({
offset: 0.5,
color: "orange",
opacity: 0.8
})]
});
const geometry = new GeomRectangle([currentStartPoint, 0], [segmentLength, stackedBarWidth]);
const rect = new Rect(geometry, {
stroke: { color: "black", width: 1 },
fill: { color: disp.color, opacity: 1 }
});