AnyBackground class final

Drawing over something you didn't choose: a wallpaper, a video frame, a gradient, a map.

A palette's background is one color the theme chose. AnyBackground is whatever is actually behind the UI, as real pixels. Build one per image, then ask it:

Everything here is ARGB ints; Flutter types live in theming/over_image_flutter.dart. See ADR-001. The pixels behind some UI, plus the contrast policy to judge them by.

The pixels are reduced lazily, once. Answers are cached, 64 per method.

Constructors

AnyBackground(List<int> _argbs, {required Algo algo, required double contrast})
argbs must be real sampled pixels from what's behind the UI. If downscaling first, use min/max pooling, never averaging: averaged black and white pixels make a mid-gray that hides both. Quantizer clusters are averages too. Alpha is ignored; every pixel is opaque.
AnyBackground.unknown({required Algo algo, required double contrast})
Nothing is known about what's behind.

Properties

algo → Algo
final
contrast → double
libmonet's 0..1 contrast dial; see Algo.getAbsoluteContrast.
final
hashCode → int
The hash code for this object.
latefinal
isUnknown → bool
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
scrimFor(int contentArgb, {Usage usage = Usage.text, int? scrimArgb}) → Scrim
The minimum-opacity scrim that makes contentArgb meet usage's contrast against every pixel, and keeps meeting it at every opacity above, so callers may round up freely.
sharedBorder(List<int> surfaceArgbs, {Usage usage = Usage.border, ColorModel colorModel = ColorModel.kDefault}) → SharedBorder
One border tone for surfaces drawn together over this background, so they read at one elevation. Each border keeps its surface's hue.
toString() → String
A string representation of this object.
override

Operators

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