GuiNormalizeGradient class

The GuiNormalizeGradient class takes a user-defined 2-dimensional color maps and normalizes it to contain equal number of stops in each row of the color map, and inserts the colors for stops at 0.0 and 1.0 if missing. Each row may be defined by an arbitrary number of gradient colors GuiGradientColor. GuiNormalizeGradient will automatically reconstruct the colormap so that each row has equal number of columns or gradient colors. If stops for 0.0 and 1.0 are missing from either row or column, it is automatically computed based on colors defined outside the range. If none were provided, then a transparent color is assumed.

Properties

colormap Map<double, List<GuiGradientColor>>
A normalized color map, with each row containing equal number of GuiGradientColor
final
gradientMaxStop double
Maximum value of stop in gradientStops
getter/setter pair
gradientMinStop double
Minimum value of stop in gradientStops
getter/setter pair
gradientStop0Idx int
Index of stop 0.0 in gradientStops
getter/setter pair
gradientStop1Idx int
Index of stop 1.0 in gradientStops
getter/setter pair
gradientStops List<double>
List of gradient stops in a row. If original map did not contain stops for 0.0 and 1.0, then it is automatically added and its color values are automatically computed based on colors around it. The list is always ordered from smallest value to largest value.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
mapMaxStop double
Maximum value of stops in mapStops
getter/setter pair
mapMinStop double
Minimum value of stop in mapStops
getter/setter pair
mapStop0Idx int
Index of stop 0.0 in mapsStops
getter/setter pair
mapStop1Idx int
Index of stop 1.0 in mapsStops
getter/setter pair
mapStops List<double>
List of color map stops. If original map did not contain stops for 0.0 and 1.0, then it is automatically added and its color values are automatically computed based on colors around it. The list is always ordered from smallest value to largest value.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

colorAt(double xStop, double yStop, [Color outOfRangeColor = Colors.transparent]) Color
Obtain Color at xStop,yStop from the normalized color map If the color can not be determined (in case xStop and yStop are out of range), the outOfRangeColor is returned. The default value of outOfRangeColor is Colors.transparent.
createImage(int width, int height) Image
Generate a ARGB image based on normalized gradient. The width and height of the image are specified as input parameters. The output is a Flutter Image widget.
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

getColorInBetween(double stop, GuiGradientColor from, GuiGradientColor to) Color
Generate a color in between two other colors, where stop is a value in between from.stop to to.stop. The color is interpolated from from and to.
getGradientInBetween(double stop, List<GuiGradientColor> fromGradient, double fromStop, List<GuiGradientColor> toGradient, double toStop) List<GuiGradientColor>
Generate a gradient in between two other gradients, where stop is a value in between fromStop to toStop. The gradient colors are interpolated from fromGradient and toGradient.