@mocanvas/editor · function

setOpacityForSelectedShapes

declare function setOpacityForSelectedShapes(editor: Editor, opacity: number): void

Set the opacity of the selected shapes.

Applied to the selected shapes themselves and not to their descendants: a group's opacity multiplies down through its children when they are drawn, so writing it to both would square it.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.