ColorSequence class
A sequence of colors representing a gradient or a color transition over time. The sequence is represented by a list of colors and a list of stops, the stops are normalized values (0.0 to 1.0) and ordered in the list. Both lists have the same number of elements.
Constructors
-
ColorSequence({required List<
Color> colors, required List<double> stops}) - Creates a new color sequence from a list of colors and a list of stops.
- ColorSequence.copy(ColorSequence sequence)
- Creates a new color sequence by copying an existing sequence.
- ColorSequence.fromStartAndEndColor({required Color start, required Color end})
- Creates a new color sequence from a start and an end color.
Properties
-
colors
↔ List<
Color> -
List of colors.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stops
↔ List<
double> -
List of color stops, normalized values (0.0 to 1.0) and ordered.
getter/setter pair
Methods
-
colorAtPosition(
double pos) → Color - Returns the color at a normalized (0.0 to 1.0) position in the color sequence. If a color stop isn't hit, the returned color will be an interpolation of a color between two color stops.
-
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