Skip to main content

Opacity

WLJS
Execution environment
Supports dynamics
Opacity[i_Real]

defines opacity for primitives (from 0 to 1)

{Opacity[0.5], Red, Disk[{-0.5,0}, 1], Blue, Disk[{0.5,0}, 1]}

Dynamics

It also supports dynamic updates combined with some primitives

opacity = 0.5;
Graphics[{Opacity[Offload[opacity]], Red, Disk[{0,0}, 1], Blue, Opacity[Offload[1.0 - opacity]], Disk[{0,0}, 1]}]

EventHandler[InputRange[0,1,0.1], Function[value,
opacity = value;
]]