pub struct Glass {
pub variant: GlassVariant,
pub shape: LiquidShape,
pub tint: Option<Color>,
pub blur_radius: Option<f32>,
pub saturation: Option<f32>,
pub chromatic_aberration: f32,
pub displacement: f32,
pub bezel_width: f32,
pub highlight: f32,
pub lift: Option<f32>,
pub shadow: bool,
pub clip: bool,
}Expand description
Builder describing a glass material. Resolved against the theme at the composition site, then evaluated per frame for density and dynamics.
Fields§
§variant: GlassVariant§shape: LiquidShape§tint: Option<Color>Tint over the refracted backdrop; defaults to the theme’s glass tint.
blur_radius: Option<f32>Backdrop blur radius in dp (defaults per variant).
saturation: Option<f32>Saturation boost (defaults per variant).
chromatic_aberration: f32Chromatic aberration spread at the bezel.
displacement: f32Lens strength: refraction displacement in px.
bezel_width: f32Bezel width in dp (the refractive rim zone).
highlight: f32Specular rim intensity.
lift: Option<f32>Screen-lift override (brightening toward white; negative darkens). Defaults per variant.
shadow: boolDrop shadow below the glass.
clip: boolClip the layer to shape. Morphing glass disables this — coverage
comes entirely from the shader’s SDF.
Implementations§
Source§impl Glass
impl Glass
pub fn regular() -> Self
pub fn clear() -> Self
Sourcepub fn lens() -> Self
pub fn lens() -> Self
The interactive lens bubble (reference: the iOS toggle/tab-bar drag lens): fully transparent, magnifying dome across the whole element, strong rainbow rim.
pub fn shape(self, shape: LiquidShape) -> Self
pub fn tint(self, tint: Color) -> Self
pub fn blur_radius(self, radius_dp: f32) -> Self
pub fn saturation(self, saturation: f32) -> Self
pub fn chromatic_aberration(self, spread: f32) -> Self
pub fn displacement(self, displacement_px: f32) -> Self
pub fn highlight(self, highlight: f32) -> Self
Sourcepub fn lift(self, lift: f32) -> Self
pub fn lift(self, lift: f32) -> Self
Overrides the screen-lift (how hard the glass brightens what it shows; the bar lens uses a near-zero lift to stay transmissive).