stopsArray

The color stops of the gradient. Can contain either plain objects or GradientStop instances.

Example

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

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

  var rect = new geom.Rect([10, 10], [200, 100]);
  var path = draw.Path.fromRect(rect, {
    fill: gradient,
    stroke: { color: "#000000", width: 2 }
  });

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