removeStop

Removes a color stop from the gradient.

Example

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

console.log("Initial stops count:", linearGradient.stops.length);

// Remove the middle stop
var middleStop = linearGradient.stops[1];
linearGradient.removeStop(middleStop);

console.log("Stops count after removal:", linearGradient.stops.length);

var surface = draw.Surface.create($("#surface"));
var rect = new draw.Rect(new geom.Rect([10, 10], [100, 40]), {
    fill: linearGradient
});
surface.draw(rect);
</script>

Parameters

stop kendo.drawing.GradientStop

The gradient color stop to remove.

In this article
removeStop
Not finding the help you need?
Contact Support