Sha256: 9c2e39f32748319d6ab382335d49c5a85806e11851ebfbd0e3e33c6aa0be75f0
Contents?: true
Size: 485 Bytes
Versions: 8
Compression:
Stored size: 485 Bytes
Contents
class Fixnum # 0xffffff.uicolor # 0xffffff.uicolor(0.33) # => # UIColor.colorWithRed(1.0, green:1.0, red: 1.0, alpha:1.0) # UIColor.colorWithRed(1.0, green:1.0, red: 1.0, alpha:0.33) def uicolor(alpha=nil) alpha = 1.0 if alpha.nil? red = ((self & 0xFF0000) >> 16).to_f / 255.0 green = ((self & 0xFF00) >> 8).to_f / 255.0 blue = (self & 0xFF).to_f / 255.0 UIColor.colorWithRed(red, green:green, blue:blue, alpha:alpha.to_f) end end
Version data entries
8 entries across 8 versions & 1 rubygems