withValues method

  1. @override
LabColor withValues(
  1. List<num> values
)

Returns a color in this color's color space with the values provided.

values should contain one value for each parameter of the color space; the alpha value is optional.

Implementation

@override
LabColor withValues(List<num> values) {
  assert(values.length == 3 || values.length == 4);
  assert(values[0] >= 0 && values[0] <= 100);
  assert(values[1] >= -128 && values[1] <= 127);
  assert(values[2] >= -128 && values[2] <= 127);
  if (values.length == 4) assert(values[3] >= 0 && values[3] <= 255);
  return LabColor.fromList(values);
}