GlassAppearance class
How UIKit's glass adapts to what is behind it (iOS 26.5 simulator, measured from its layers over stepped backdrops): the tab bar's, and any glass up to 64pt in its short side.
UIKit reads the backdrop's mean luma (Rec. 709 on its colors) around the glass, about every frame, and keeps a light or a dark appearance with hysteresis. The glass's color inputs follow the luma and the appearance on a critically damped 0.5s spring; the resting selection's on a 0.24s one; the symbols and labels switch at once.
Larger glass (see height) does not read the backdrop: it takes the system's appearance and fixed inputs.
Constructors
- GlassAppearance({Brightness system = Brightness.light})
-
An appearance starting from the
system's, before any backdrop is read.
Properties
- adaptive ← bool
-
Whether the appearance follows the backdrop. When false, it keeps the
system's, and only the glass's colors follow the backdrop's luma.
no getter
- chroma → double
-
The face's chroma gain: 1, but less with contrast or
reduceTransparency.
no setter
- contrast ← bool
-
Increase Contrast, as UIKit's glass honors it (iOS 26.5, from its
filters' inputs): the light glass is filled 80% white over its face,
its face keeps 0.8 / 1.1 of the chroma it would, and its shadow's fill
is 0.12.
no getter
- face → (double, double, double, double)
-
The platter's face: luma black and white points, fill alpha and gray.
no setter
- fixed ↔ bool
-
Whether the glass keeps the system's appearance and large glass's
fixed face at any size (UIKit's edit menu: 46pt, yet it does not
follow what is behind it). Its other inputs still follow its size.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- height ↔ double
-
The glass's short side, in points: the shadow's opacity follows it,
and glass taller than 64pt has the fixed inputs of large glass. The
bar's, 62pt, by default.
getter/setter pair
- isDark → bool
-
Whether the glass is in its dark appearance.
no setter
- isLarge → bool
-
Whether the glass is large: taller than 64pt, it keeps the system's
appearance whatever is behind it, and its inputs are fixed.
no setter
- lensRim → (double, double, double)
-
The lens's rim matrix.
no setter
- luma → double
-
The backdrop's luma, as last sampled.
no setter
- pill → (double, double, double)
-
The resting selection's matrix.
no setter
- platterRim → (double, double, double)
-
The platter's and the lens's rim matrices.
no setter
- reduceTransparency ← bool
-
Reduce Transparency, the same way: on top of contrast's fill and
shadow, the light glass maps every luma to 0.9, keeps 0.9 / 1.1 of the
chroma, and does not refract; the bar blurs what is below it heavily
(see GlassTabBar).
no getter
- refraction → double
-
How much the glass refracts: none with reduceTransparency.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shadow → double
-
The platter shadow's strength.
no setter
- symbol → (double, double)
-
Normal symbols' luma weight and lift.
no setter
- system ← Brightness
-
The system's appearance: the bar's own until the backdrop says
otherwise.
no getter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sample(
double luma, {bool snap = true}) → void -
A new reading of the backdrop's luma under the bar. The first one
takes effect at once unless
snapis false (glass that is still materializing, which UIKit shows in its default look first); later ones after a moment, and animate. -
tick(
double now) → bool -
Advances the springs to
now(seconds). Returns whether anything is still moving. -
toString(
) → String -
A string representation of this object.
inherited
-
wouldKeep(
double luma) → bool -
Whether a reading of
lumawould change nothing: it is the luma in effect, and no other reading is still waiting to take effect.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- debugOnChange ↔ void Function(GlassAppearance appearance, String event)?
-
Called after every tick and sample, for logging.
getter/setter pair
Static Methods
-
glassSampleArea(
Rect glass) → Rect -
Where UIKit reads the backdrop under
glass(a glass of its own, not the bar): the glass grown by its margin, a fifth of its short side. -
sampleArea(
Rect bar) → Rect - Where UIKit reads the backdrop: its mean luma over the bar's container (the screen's width, from the bar's top to the screen's bottom) grown by the glass's 12.4pt margin. For a bar laid out 21pt from the screen's sides and bottom, that is the bar grown by 21pt to the sides and below and 12.4pt above.