GlassAppearance class
How a glass tab bar adapts to what is behind it, as UIKit's does (iOS 26.5 simulator, measured from its layers over stepped backdrops).
UIKit reads the backdrop's mean luma (Rec. 709 on its colors) around the bar, 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.
Constructors
- GlassAppearance({Brightness system = Brightness.light})
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
- hashCode → int
-
The hash code for this object.
no setterinherited
- isDark → bool
-
Whether the glass is in its dark appearance.
no setter
- lensRim → (double, double, double)
-
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) → void - A new reading of the backdrop's luma under the bar. The first one takes effect at once; 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
-
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.