opacity

Gets or sets the element opacity. Inherited from Element.opacity

If set, the stroke and fill opacity will be multiplied by the element opacity.

Example

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

    var arcGeometry = new geom.Arc([100, 100], {
        radiusX: 30,
        radiusY: 30,
        startAngle: 0,
        endAngle: 270
    });
    var arc = new draw.Arc(arcGeometry)
        .fill("red")
        .stroke("blue", 2);

    var surface = draw.Surface.create($("#surface"));
    surface.draw(arc);

    // Get current opacity
    console.log("Current opacity:", arc.opacity());

    // Set new opacity
    arc.opacity(0.3);

    // Get updated opacity
    console.log("Updated opacity:", arc.opacity());
</script>

Parameters

opacity Number

The element opacity. Ranges from 0 (completely transparent) to 1 (completely opaque).

Returns

Number The current element opacity.

In this article
opacity
Not finding the help you need?
Contact Support