Open xonaman opened 2 years ago
Similar to Color.lerp, but it supports more than just two colors.
Very useful in my case, so I thought I might as well share it.
Edit: Please add import 'dart:math' as math;, I forgot it
import 'dart:math' as math;
Example usage:
LinearProgressIndicator( value: progress, color: ColorUtils.lerp([ Colors.red, Colors.yellow, Colors.green, ], progress), )
@xonaman Looks great! Can you please add a unit test ?
Similar to Color.lerp, but it supports more than just two colors.
Very useful in my case, so I thought I might as well share it.
Edit: Please add
import 'dart:math' as math;
, I forgot itExample usage: