ContrastRule class
Flags text whose contrast against its background is below the WCAG minimum.
Reads the samples gathered by the raster collector; a pure-Dart snapshot has none and the rule yields nothing. Normal text needs a ratio of at least 4.5:1 and large text at least 3:1. Disabled controls are exempt (WCAG 1.4.3 excludes them), and ratios just below the threshold are downgraded to a warning because pixel sampling over gradients and images is false-positive prone.
- Implemented types
Constructors
- ContrastRule()
-
Creates a ContrastRule.
const
Properties
- confidence → Confidence
-
How much to trust this rule's findings.
no setteroverride
- criterion → Criterion
-
The standard clause this rule enforces.
no setteroverride
- defaultSeverity → Severity
-
The severity findings get unless configuration overrides it.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
The stable rule id, e.g.
attest/interactive-name.no setteroverride - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
evaluate(
SemanticsSnapshot snapshot, RuleContext context) → Iterable< Finding> -
Inspects
snapshotand yields zero or more findings.override -
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