LensSpec class

How a lens bends what's under it, as Glisse's LensOptions.

Annotations

Constructors

LensSpec.new({required double strength, required double dispersion, required double depth, double dome = 0, double splay = 1, bool relative = false, bool bezel = false, double? maxDepth, bool ink = false, double blur = 0, bool paintsLight = false, double? darkStrength})
Creates a lens that bends by strength over a band depth wide.
const

Properties

bezel → bool
Bends as light does through a rounded bezel: straight in from the rim, most at the very edge, by Snell's law over a squircle's slope.
final
blur → double
Softens what the rim bends, as iOS's tab bar lens does.
final
darkStrength → double?
The strength on a dark page, if it differs.
final
depth → double
The width of the band round the rim that bends, in px, or a share of the shorter side when relative.
final
dispersion → double
How much further red bends than blue: at 1, a fifth further.
final
dome → double
The sag of the dome whose slope sets the bend along the rim.
final
hashCode → int
The hash code for this object.
no setteroverride
ink → bool
Whether the content is ink, such as labels, whose colours fringe.
final
maxDepth → double?
The most depth comes to, in px, when it is relative.
final
paintsLight → bool
Carried over from Glisse's lens options, where it marks a lens that paints its own rim light. Nothing reads it yet: the shader always lights the rim from the draw's LensLight.
final
relative → bool
Whether depth is a share of the lens's shorter side rather than px.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
splay → double
How far the bend near each side keeps to that side's own direction.
final
strength → double
How far in the rim reaches for what it shows: a share of the bezel's width for a bezel, else of the lens's shorter side.
final

Methods

copyWith({double? strength, double? dispersion, double? blur}) → LensSpec
A copy with the given strength, dispersion or blur replaced.
depthOf(Size size) → double
The width of the band that bends, for a lens of size.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reachOf(Size size, {double? strengthOverride, required bool dark}) → double
How far the rim reaches, in px, for a lens of size.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
override

Constants

glass → const LensSpec
Glass's own lens: a bezel three tenths of its shorter side wide, 36px at most, reaching as far in again as the band is wide.
segment → const LensSpec
A segmented control's lifted selection, after Aave's toggle group.
sliderThumb → const LensSpec
A slider's lifted thumb, after Aave's slider.
switchThumb → const LensSpec
A switch's lifted thumb, after Aave's switch.
tab → const LensSpec
A tab bar's lifted selection, as iOS 26.1's tab bar lens.