pub struct Glass {Show 20 fields
pub variant: GlassVariant,
pub shape: LiquidShape,
pub tint: Option<Color>,
pub blur_radius: Option<f32>,
pub saturation: Option<f32>,
pub chromatic_aberration: f32,
pub dispersion_axes: (f32, f32),
pub displacement: f32,
pub bezel_width: f32,
pub highlight: f32,
pub surface_profile: GlassSurfaceProfile,
pub sheen: Option<f32>,
pub lift: Option<f32>,
pub shadow: bool,
pub shadow_style: Option<GlassShadow>,
pub clip: bool,
pub foreground: Option<Color>,
pub adaptive_frost: f32,
pub content_recolor: Option<(Color, f32)>,
pub edge_fold: f32,
}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.
dispersion_axes: (f32, f32)Principal-axis wavelength response for the X-Z and Y-Z profiles.
displacement: f32Lens strength: refraction displacement in px.
bezel_width: f32Bezel width in dp (the refractive rim zone).
highlight: f32Specular rim intensity.
surface_profile: GlassSurfaceProfilePhysical X-Z/Y-Z cross-sections for the surface.
sheen: Option<f32>Broad Fresnel sheen across the bezel. None uses the variant default.
lift: Option<f32>Screen-lift override (brightening toward white; negative darkens). Defaults per variant.
shadow: boolDrop shadow below the glass.
shadow_style: Option<GlassShadow>Per-surface shadow override.
clip: boolClip the layer to shape. Morphing glass disables this — coverage
comes entirely from the shader’s SDF.
foreground: Option<Color>Foreground color whose contrast the frost must protect. None uses
the theme label color.
adaptive_frost: f32Strength of backdrop+foreground frost adaptation.
content_recolor: Option<(Color, f32)>Accent applied only to dark foreground detail sampled inside the glass.
edge_fold: f32Top-edge fold strength (0 = off): content just above the glass renders vertically mirrored inside the top band (the reference bar’s meniscus folds section headers upside-down into it).
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 dispersion_axes(self, x: f32, y: f32) -> Self
pub fn displacement(self, displacement_px: f32) -> Self
pub fn bezel_width(self, width_dp: f32) -> Self
pub fn highlight(self, highlight: f32) -> Self
pub fn surface_profile(self, profile: GlassSurfaceProfile) -> Self
pub fn sheen(self, sheen: 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).