optics
Sets the optical model used to refract and blur captured content.
Replaces the whole model. To change part of the built-in model, copy it, for example optics(GlassOptics.regular.copy(blurRadius = OpticalSizeValue.Fixed(30.dp))).
Transforms the optics established by defaults and earlier Style writes.
Every Style evaluation starts from GlassStyle.regular, so the receiver is GlassOptics.regular as modified by LocalGlassStyle and earlier writes in this Style.
For example, GlassStyle.clear.then { optics { copy(blurRadius = OpticalSizeValue.Fixed(4.dp)) } } changes Clear's blur without replacing its other optical values. Later optics writes or built-in styles can replace the result.
transform runs on each Style evaluation, not when the Style is constructed. Snapshot state reads are observed by each consuming node. Keep it free of side effects. Invalid values are rejected by GlassOptics construction, including GlassOptics.copy.