New to Kendo UI for jQueryStart a free 30-day trial

Opacity

methods

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

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

Parameters:opacityNumber

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

Returns:Number

The current element opacity.

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

    var rectGeometry = new geom.Rect([0, 0], [100, 100]);
    var rect = new draw.Rect(rectGeometry).fill("blue");

    // Set opacity
    rect.opacity(0.6);

    // Get current opacity
    var currentOpacity = rect.opacity();
    console.log("Current opacity:", currentOpacity);

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