Contrast class abstract final

WCAG 2.x contrast helpers (spec §5.4 guardrails).

Properties

hashCode → int
The hash code for this object.
no setterinherited
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
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

luminance(Color color) → double
WCAG relative luminance of color (alpha ignored), 0 (black) to 1 (white).
meets(Color foreground, Color background, {double minimum = minText}) → bool
Whether foreground on background reaches minimum (default minText).
ratio(Color foreground, Color background) → double
WCAG contrast ratio between foreground and background, 1 to 21.

Constants

minLargeText → const double
Minimum ratio for large text (the display): WCAG AA 3:1.
minText → const double
Minimum ratio for normal-size text (key labels): WCAG AA 4.5:1.