removeStop

Removes a color stop from the gradient. Inherited from Gradient.removeStop

Example

<div id="surface"></div>
<script>
  var draw = kendo.drawing;
  var geom = kendo.geometry;

  var gradient = new draw.LinearGradient({
    start: [0, 0],
    end: [1, 0],
    stops: [
      { offset: 0, color: "#ff0000" },
      { offset: 0.5, color: "#ffff00" },
      { offset: 1, color: "#0000ff" }
    ]
  });

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

  // Remove the middle stop
  var middleStop = gradient.stops[1];
  gradient.removeStop(middleStop);
  console.log("Stops count after removal:", gradient.stops.length);

  var rect = new geom.Rect([10, 10], [200, 80]);
  var path = draw.Path.fromRect(rect, {
    fill: gradient,
    stroke: null
  });

  var surface = draw.Surface.create($("#surface"));
  surface.draw(path);
</script>

Parameters

stop kendo.drawing.GradientStop

The gradient color stop to remove.

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