Sha256: 81f1307900634e8f266c6047d3f4ffa90c08670a9f1248e68a10561081ccd498

Contents?: true

Size: 273 Bytes

Versions: 5

Compression:

Stored size: 273 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)
    self.uicolor(alpha).CGColor
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sugarcube-1.7.0 lib/sugarcube-color/uiimage.rb
sugarcube-1.6.3 lib/sugarcube-color/uiimage.rb
sugarcube-1.6.2 lib/sugarcube-color/uiimage.rb
sugarcube-1.6.1 lib/sugarcube-color/uiimage.rb
sugarcube-1.6.0 lib/sugarcube-color/uiimage.rb