Sha256: a4e93b3da63e0721247390cee169e8757407def9064440154565bd636da88314
Contents?: true
Size: 733 Bytes
Versions: 13
Compression:
Stored size: 733 Bytes
Contents
module BubbleWrap module_function # @return [UIcolor] def rgb_color(r,g,b) rgba_color(r,g,b,1) end # @return [UIcolor] def rgba_color(r,g,b,a) r,g,b = [r,g,b].map { |i| i / 255.0} if a > 1.0 a = a / 255.0 end 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=nil) NSBundle.mainBundle.localizedStringForKey(key, value:value, table:nil) end # I had issues with #p on the device, this is a temporary workaround def p(arg) NSLog arg.inspect end def create_uuid uuid = CFUUIDCreate(nil) CFUUIDCreateString(nil, uuid) end end
Version data entries
13 entries across 13 versions & 1 rubygems