removeStop

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

Example

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

  var gradient = new draw.RadialGradient({
    center: [0.5, 0.5],
    radius: 0.7,
    stops: [
      { offset: 0, color: "#ff0000", opacity: 1 },
      { offset: 0.5, color: "#00ff00", opacity: 0.8 },
      { offset: 1, color: "#0000ff", opacity: 0.5 }
    ]
  });

  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([0, 0], [110, 110]);
  var path = draw.Path.fromRect(rect, {
    stroke: null,
    fill: gradient
  });

  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