diff options
| -rw-r--r-- | lib/ruby2d/color.rb | 2 | ||||
| -rw-r--r-- | test/color_spec.rb | 6 |
2 files changed, 1 insertions, 7 deletions
diff --git a/lib/ruby2d/color.rb b/lib/ruby2d/color.rb index 768ebce..a41e6c7 100644 --- a/lib/ruby2d/color.rb +++ b/lib/ruby2d/color.rb @@ -84,7 +84,7 @@ module Ruby2D # Array of Floats from 0.0..1.0 c.class == Array && c.length == 4 && c.all? { |el| - el.is_a?(Numeric) && (0.0..1.0).include?(el) + el.is_a?(Numeric) } end diff --git a/test/color_spec.rb b/test/color_spec.rb index 76ebe24..c2f2cfa 100644 --- a/test/color_spec.rb +++ b/test/color_spec.rb @@ -18,12 +18,6 @@ RSpec.describe Ruby2D::Color do expect(Ruby2D::Color.is_valid? [1, 0, 0.0, 1.0]).to eq true expect(Ruby2D::Color.is_valid? [1.0, 0, 0]).to eq false end - - it 'prevents color values that are out of range' do - expect(Ruby2D::Color.is_valid? [1.2, 0, 0, 0]).to eq false - expect(Ruby2D::Color.is_valid? [0, 0, -0.1, 0]).to eq false - expect(Ruby2D::Color.is_valid? [0, 0, 0, 2]).to eq false - end end describe '#new' do |
