Class: Abachrome::ColorModels::HSV
- Inherits:
-
Base
- Object
- Base
- Abachrome::ColorModels::HSV
- Defined in:
- lib/abachrome/color_models/hsv.rb
Instance Method Summary collapse
-
#valid_coordinates?(coordinates) ⇒ Boolean
Validates whether the coordinates are valid for the HSV color model.
Instance Method Details
#valid_coordinates?(coordinates) ⇒ Boolean
Validates whether the coordinates are valid for the HSV color model. Each component (hue, saturation, value) must be in the range [0, 1].
hue (h), saturation (s), and value (v) in the range [0, 1]
37 38 39 40 41 42 |
# File 'lib/abachrome/color_models/hsv.rb', line 37 def valid_coordinates?(coordinates) h, s, v = coordinates h >= 0 && h <= 1.0 && s >= 0 && s <= 1.0 && v >= 0 && v <= 1.0 end |