rubymotion-community / sugarcube

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

NSString : broken UIColor from color name #43

Closed kpricorn closed 11 years ago

kpricorn commented 11 years ago

The uicolor method on NSString does not work as mentioned in the README

# UIColor from color name OR image name OR hex code
"blue".uicolor == :blue.uicolor # => UIColor.blueColor

"blue".uicolor always returns nil. Perhaps this behaviour is intended and the README is outdated (`:unknown_color.uicolor raises an exception, but 'unknown_color' simply returns nil)

kpricorn commented 11 years ago

See https://github.com/sdecastelberg/sugarcube/commit/38f15918fc81b3920588e1b7c5945aa6f7282b75 for possible specs and implementation.

colinta commented 11 years ago

Ahh thank you, the "blue".uicolor changed long ago, but I never updated the README.

"blue".uicolor => "blue".uiimage.uicolor
=> UIColor.colorWithPatternImage(UIImage.imageNamed("blue"))
colinta commented 11 years ago

Fixed in 182deb1