set method

X set(
  1. num r,
  2. num g,
  3. num b,
  4. num a,
)

Sets all components at once.

Values are converted using num.toInt, truncating any fractional part.

Returns this instance for fluent chaining.

Implementation

X set(num r, num g, num b, num a) {
  this.r = r.toInt();
  this.g = g.toInt();
  this.b = b.toInt();
  this.a = a.toInt();
  return this as X;
}