stopsArray

The array of gradient color stops. Contains GradientStop instances.

Example

<div id="surface"></div>
<script>
var draw = kendo.drawing;
var geom = kendo.geometry;
var linearGradient = new draw.LinearGradient({
    stops: [
        { offset: 0, color: "#00ff00", opacity: 1 },
        { offset: 1, color: "#0000ff", opacity: 1 }
    ]
});

// Access the stops field
console.log("Number of stops:", linearGradient.stops.length);
Array.from(linearGradient.stops).forEach(function(stop, index) {
    console.log("Stop " + index + ":", stop.offset, stop.color, stop.opacity);
});

var surface = draw.Surface.create($("#surface"));
var rect = new draw.Rect(new geom.Rect([10, 10], [80, 40]), {
    fill: linearGradient
});
surface.draw(rect);
</script>
In this article
stops
Not finding the help you need?
Contact Support