Sha256: 25f3d872a329c8849dc95ae1e843ef41b23edef4c008372e8e9705deb4dd6d18

Contents?: true

Size: 328 Bytes

Versions: 54

Compression:

Stored size: 328 Bytes

Contents

class NSImage

  # @return [NSColor]
  def nscolor(alpha=nil)
    color = NSColor.colorWithPatternImage(self)
    if not alpha.nil?
      color = color.colorWithAlphaComponent(alpha.to_f)
    end

    color
  end

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

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

end

Version data entries

54 entries across 54 versions & 1 rubygems

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