Sha256: b0559eaa99832eff3f383a01fce2417e959f3a6537b86888817a56faad927393

Contents?: true

Size: 690 Bytes

Versions: 3

Compression:

Stored size: 690 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 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

3 entries across 3 versions & 1 rubygems

Version Path
bubble-wrap-1.5.0 motion/core.rb
bubble-wrap-1.5.0.rc1 motion/core.rb
bubble-wrap-1.4.0 motion/core.rb