jfairbank / chroma

Ruby gem for color manipulation and palette generation
ISC License
234 stars 29 forks source link

Equality is still off due to floating point math #13

Closed jfairbank closed 9 years ago

jfairbank commented 9 years ago
irb(main):003:0> 'yellow'.paint.send(:rgb)
=> #<Chroma::ColorModes::Rgb:0x007fa088e1f1d8 @r=255, @g=255, @b=0, @a=1.0>
irb(main):004:0> 'red'.paint.spin(60).send(:rgb)
=> #<Chroma::ColorModes::Rgb:0x007fa088e25330 @r=254.99999999999994, @g=255.0, @b=0, @a=1>
irb(main):005:0> 'yellow'.paint == 'red'.paint.spin(60)
=> false
jfairbank commented 9 years ago

Fixed in first-release branch.