NmContrast class abstract final

WCAG 2.x contrast helpers used to derive text shades and dark palettes.

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 c) → double
Relative luminance of c (0 = black, 1 = white).
matchRatio(Color source, Color background, double target, {bool lighter = true, double saturationScale = 1}) → Color
Returns a color with the hue (and scaled saturation) of source whose contrast against background is as close as possible to target.
ratio(Color a, Color b) → double
Contrast ratio between a and b, from 1 to 21.