motion/core.rb in bubble-wrap-1.2.0 vs motion/core.rb in bubble-wrap-1.3.0.osx
- old
+ new
@@ -6,10 +6,15 @@
rgba_color(r,g,b,1)
end
# @return [UIcolor]
def rgba_color(r,g,b,a)
- UIColor.colorWithRed((r/255.0), green:(g/255.0), blue:(b/255.0), alpha:a)
+ r,g,b = [r,g,b].map { |i| i / 255.0}
+ if App.osx?
+ NSColor.colorWithDeviceRed(r, green: g, blue: b, alpha: a)
+ else
+ UIColor.colorWithRed(r, green: g, blue:b, alpha:a)
+ end
end
def localized_string(key, value)
NSBundle.mainBundle.localizedStringForKey(key, value:value, table:nil)
end