Method: NSColor.rgba

Defined in:
lib/osx/sugarcube-color/nscolor.rb

.rgba(r, g, b, a) ⇒ Object



32
33
34
35
36
37
38
# File 'lib/osx/sugarcube-color/nscolor.rb', line 32

def self.rgba(r, g, b, a)
  if NSColor.respond_to?('colorWithRed:green:blue:alpha:')
    NSColor.colorWithRed(r, green: g, blue: b, alpha: a)
  else
    NSColor.colorWithCalibratedRed(r, green: g, blue: b, alpha: a)
  end
end