Skip to main content

layer

Function layer 

Source
pub fn layer(container: Rgba, content: Rgba, opacity: f32) -> Rgba
Expand description

Composite a state layer of content at opacity over container (source-over alpha compositing).

This is the one state-layer recipe for every component. The layer’s opacity multiplies content’s own alpha, and RGB is weighted by alpha, so a layer over a transparent container keeps its own hue instead of darkening toward the container’s stored RGB.