Method: ColorLib::GrayScale#-
- Defined in:
- lib/color_lib/grayscale.rb
#-(other) ⇒ Object
Subtracts another colour to the current colour. The other colour will be converted to grayscale before subtraction. This conversion depends upon a #to_grayscale method on the other colour.
The subtraction is done using the grayscale accessor methods to ensure a valid colour in the result.
190 191 192 193 194 195 |
# File 'lib/color_lib/grayscale.rb', line 190 def -(other) other = other.to_grayscale ng = self.dup ng.g -= other.g ng end |