stopsArray

The array of gradient color stops. Contains GradientStop instances.

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.8,
    stops: [
      { offset: 0, color: "#333333", opacity: 1 },
      { offset: 1, color: "#cccccc", opacity: 0.5 }
    ]
  });

  // Access the stops field
  console.log("Number of stops:", gradient.stops.length);
  console.log("First stop color:", gradient.stops[0].color());

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

  var surface = draw.Surface.create($("#surface"));
  surface.draw(path);
</script>
In this article
stops
Not finding the help you need?
Contact Support