class RGBUtils::Color

Constants

MAX_VALUE
MIN_VALUE

Public Instance Methods

coerce(value) click to toggle source
# File lib/rgb_utils/attributes/color.rb, line 6
def coerce(value)
  value = value.to_i

  return MIN_VALUE if value < MIN_VALUE
  return MAX_VALUE if value > MAX_VALUE

  value
end