title | page_title | res_type |
---|---|---|
LinearGradient |
API reference for Kendo UI Drawing API LinearGradient |
api |
Represents a linear color gradient.
<div id="surface" />
<script>
var draw = kendo.drawing;
var geom = kendo.geometry;
var gradient = new draw.LinearGradient({
start: [0, 0], // Left, top
end: [1, 1], // Bottom, right
stops: [{
offset: 0,
color: "#f00",
opacity: 0
}, {
offset: 1,
color: "#f00",
opacity: 0.8
}]
});
var rect = new geom.Rect([
// Origin X, Y
0, 0
], [
// Width, height
100, 50
]);
var path = draw.Path.fromRect(rect, {
stroke: null,
fill: gradient
});
var surface = draw.Surface.create($("#surface"));
surface.draw(path);
</script>
The configuration of this LinearGradient.
The color stops of the gradient. Can contain either plain objects or GradientStop instances.
The array of gradient color stops. Contains GradientStop instances.
Adds a color stop to the gradient. Inherited from Gradient.addStop
The color of the stop.
The fill opacity.
kendo.drawing.GradientStop
The new gradient color stop.
Gets or sets the end point of the gradient.
The end point of the gradient.
Coordinates are relative to the shape bounding box. For example [0, 0] is top left and [1, 1] is bottom right.
kendo.geometry.Point
The current end point of the gradient.
Gets or sets the start point of the gradient.
The start point of the gradient.
Coordinates are relative to the shape bounding box. For example [0, 0] is top left and [1, 1] is bottom right.
kendo.geometry.Point
The current start point of the gradient.
Removes a color stop from the gradient. Inherited from Gradient.removeStop
The gradient color stop to remove.