code: def _clamp_rgb_coordinate(self, coord):
          
          if not self.is_upscaled:
              return min(max(coord, 0.0), 1.0)
          else:
              return min(max(coord, 1), 255)
docs: Clamps an RGB coordinate, taking into account whether or not the
          color is upscaled or not.
  
          :param float coord: The coordinate value.
          :rtype: float
          :returns: The clamped value.