gradient static method
List<Color>
gradient(
- Color start,
- Color end, {
- int numberOfColors = 5,
- InterpolationMethod method = InterpolationMethod.oklab,
- bool shortestPath = true,
Implementation
static List<Color> gradient(Color start, Color end, {int numberOfColors = 5, InterpolationMethod method = InterpolationMethod.oklab, bool shortestPath = true}) {
final colors = <Color>[];
for (int i = 0; i < numberOfColors; i++) {
final fraction = i / (numberOfColors - 1);
final lerped = interpolate(start, end, fraction, method: method, shortestPath: shortestPath);
colors.add(lerped);
}
return colors;
}