clamp method

Rgb clamp()

Returns a new RGB color where the r, g, and b channels are clamped to the range [0, 255] and rounded to the nearest integer value, and the opacity is clamped to the range [0, 1].

Implementation

Rgb clamp() {
  return Rgb(_clampi(r), _clampi(g), _clampi(b), _clampa(opacity));
}