ToneDeltaPair class final
Documents a constraint between two DynamicColors, in which their tones must have a certain distance from each other.
The polarity is an adjective that describes "A", compared to "B". For instance, ToneDeltaPair(A, B, 15, 'darker') states that A's tone should be at least 15 darker than B's.
Prefer a DynamicColor with a background, this is for special cases when designers want tonal distance, literally contrast, between two colors that don't have a background / foreground relationship or a contrast guarantee.
Constructors
- ToneDeltaPair({required DynamicColor roleA, required DynamicColor roleB, required double delta, required TonePolarity polarity, bool stayTogether = true, DeltaConstraint constraint = .exact})
-
const
Properties
- constraint → DeltaConstraint
-
How to fulfill the tone delta pair constraint.
final
- delta → double
-
Required difference between tones.
Absolute value, negative values have undefined behavior.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- polarity → TonePolarity
-
The relative relation between tones of roleA and roleB.
final
- roleA → DynamicColor
-
The first role in a pair.
final
- roleB → DynamicColor
-
The second role in a pair.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stayTogether → bool
-
Whether these two roles should stay on the same side
of the "awkward zone" (T50-59). This is necessary for certain cases where
one role has two backgrounds.
final
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.
override