diff --git a/lib/rainbow/color.rb b/lib/rainbow/color.rb index 3864824..1a29575 100644 --- a/lib/rainbow/color.rb +++ b/lib/rainbow/color.rb @@ -12,7 +12,12 @@ def self.build(ground, values) color = values.size == 1 ? values.first : values case color - when Integer + # NOTE: Properly handle versions before/after Ruby 2.4.0. + # Ruby 2.4+ unifies Fixnum & Bignum into Integer. + # However previous versions would still use Fixnum. + # To avoid missing `Fixnum` input, call `0.class` which would + # return either `Integer` or `Fixnum`. + when 0.class Indexed.new(ground, color) when Symbol if Named.color_names.include?(color)