rubymotion-community / sugarcube

Some sugar for your cocoa. RubyMotion helpers.
Other
421 stars 66 forks source link

NSColor on 10.8 #205

Closed bmichotte closed 9 years ago

bmichotte commented 9 years ago
+ (NSColor *)colorWithRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha

has been introduced on 10.9

This PR add a test for NSColor responding to this method, otherwise call

+ (NSColor *)colorWithCalibratedRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha

thanks

colinta commented 9 years ago

Nice, thanks for adding that check.

I wonder if we should add a centralized helper for that check... but I can't think of where. Maybe a future refactor.

I'm down a rabbit hole at the moment, getting specs to run again for OS X. They've been broken for a long time, and there are legitimate bugs!

bmichotte commented 9 years ago

I thought of adding something like ˋNSColor.rgba(r, g, b, a)ˋ and do the check in this method. Can refactor it if you want

bmichotte commented 9 years ago

So ˋ does not work on iPhone ;)

colinta commented 9 years ago

Yeah let's do that, it'll be easier for people to use that code as an example in the future.

bmichotte commented 9 years ago

Here we go !

colinta commented 9 years ago

Nice! I've got my spec fixes on another branch, merging next.