Color.fromList constructor

Color.fromList(
  1. dynamic rgb,
  2. [dynamic alpha = 1,
  3. String originalForm]
)

rgb is a List 128, 255, 0 or 62.2, 125.5, 67 The decimal arguments came from color operations

alpha 0 < alpha < 1. Default = 1.

Implementation

Color.fromList(rgb, [alpha = 1, String originalForm]) {
  this.rgb = <num>[for (var c in rgb) c.clamp(0, 255)];
  this.alpha = (alpha ?? 1).clamp(0, 1);
  if (originalForm != null) value = originalForm;
}