def +(other)
      rgb =
        case other
        when RGB
          compound_by(other.rgb) { |a, b| [a+b, 255].min }
        when Array
          raise ArgumentError, "Invalid size of Array given" unless other.size==3
          compound_by(other) { |a, b| (a + b) % 256 }
        when Integer
          compound_by([other] * 3) { |a, b| (a + b) % 256 }
        else
          raise ArgumentError, "Invalid argument given"
        end
      self.class.new *rgb
    end
def +(other)
      rgb =
        case other
        when RGB
          compound_by(other.rgb) { |a, b| [a+b, 255].min }
        when Array
          raise ArgumentError, "Invalid size of Array given" unless other.size==3
          compound_by(other) { |a, b| (a + b) % 256 }
        when Integer
          compound_by([other] * 3) { |a, b| (a + b) % 256 }
        else
          raise ArgumentError, "Invalid argument given"
        end
      self.class.new *rgb
    end
Color addition

 +other+ can be:
   RGB object: apply minimum compositing.
   Array of RGB values: each values added to each of RGBs.
   Integer: other number added to all of RGBs.