title | page_title | res_type |
---|---|---|
RadialGradient |
API reference for Kendo UI Drawing API RadialGradient |
api |
Represents a radial color gradient.
<div id="surface" />
<script>
var draw = kendo.drawing;
var geom = kendo.geometry;
var gradient = new draw.RadialGradient({
// Center and radius are relative to shape size
center: [ 0.75, 0.5 ],
radius: 0.5,
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 RadialGradient.
The center of the gradient.
Coordinates are relative to the shape bounding box. For example [0, 0] is top left and [1, 1] is bottom right.
The radius of the radial gradient relative to the shape bounding box.
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 center point of the gradient.
The center 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 radius of the gradient.
Gets or sets the radius of the gradient.
The new radius of the gradient.
Number
The current radius of the gradient.
Removes a color stop from the gradient. Inherited from Gradient.removeStop
The gradient color stop to remove.