withValues method

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

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
CmykColor withValues(List<num> values) {
  assert(values.length == 4 || values.length == 5);
  assert(values[0] >= 0 && values[0] <= 100);
  assert(values[1] >= 0 && values[1] <= 100);
  assert(values[2] >= 0 && values[2] <= 100);
  assert(values[3] >= 0 && values[3] <= 100);
  if (values.length == 5) assert(values[4] >= 0 && values[4] <= 255);
  return CmykColor.fromList(values);
}