Sha256: ae6f6fb8bf1e9253162faa0b6d0afa99dc5b06f26999d6e40c18fe42eb4d8e0c

Contents?: true

Size: 319 Bytes

Versions: 54

Compression:

Stored size: 319 Bytes

Contents

class UIImage

  # @return [UIColor]
  def uicolor(alpha=nil)
    color = UIColor.colorWithPatternImage(self)
    if alpha
      color = color.colorWithAlphaComponent(alpha.to_f)
    end

    color
  end

  def cgcolor(alpha=nil)
    uicolor(alpha).CGColor
  end

  def skcolor(alpha=nil)
    uicolor(alpha)
  end

end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
sugarcube-2.4.2 lib/ios/sugarcube-color/uiimage.rb
sugarcube-2.4.1 lib/ios/sugarcube-color/uiimage.rb
sugarcube-2.4.0 lib/ios/sugarcube-color/uiimage.rb
sugarcube-2.3.0 lib/ios/sugarcube-color/uiimage.rb
sugarcube-2.2.0 lib/ios/sugarcube-color/uiimage.rb
sugarcube-2.1.5 lib/ios/sugarcube-color/uiimage.rb
sugarcube-2.1.4 lib/ios/sugarcube-color/uiimage.rb
sugarcube-2.1.3 lib/ios/sugarcube-color/uiimage.rb
sugarcube-2.1.2 lib/ios/sugarcube-color/uiimage.rb
sugarcube-2.1.1 lib/ios/sugarcube-color/uiimage.rb
sugarcube-2.1.0 lib/ios/sugarcube-color/uiimage.rb
sugarcube-2.0.2 lib/ios/sugarcube-color/uiimage.rb
sugarcube-2.0.1 lib/ios/sugarcube-color/uiimage.rb
sugarcube-2.0.0 lib/ios/sugarcube-color/uiimage.rb