isInGamut property

bool get isInGamut

Whether this color is in-gamut for its color space.

Implementation

bool get isInGamut {
  if (!space.isBounded) return true;

  // There aren't (currently) any color spaces that are bounded but not
  // STRICTLY bounded, and have polar-angle channels.
  return _isChannelInGamut(channel0, space.channels[0]) &&
      _isChannelInGamut(channel1, space.channels[1]) &&
      _isChannelInGamut(channel2, space.channels[2]);
}