rLinearGradient function

List<List<num>> rLinearGradient (
  1. num n,
  2. List<num> color1,
  3. List<num> color2
)

returns a rounded, length n array of Vector3 colours. colours are evenly spaced between color1 and color2.

Implementation

List<List<num>> rLinearGradient(num n, List<num> color1, List<num> color2) {
  return linearGradient(n, color1, color2)
      .map((color) => color.map((c) => c.round()).toList())
      .toList();
}