Sha256: e2aecc262fe9eaffb8bf1900a92ef8a7696c1e3170ba5b4b3bb9e4488a02b1ae
Contents?: true
Size: 338 Bytes
Versions: 29
Compression:
Stored size: 338 Bytes
Contents
class NSString # @return [UIColor] def uicolor(alpha=nil) if self[0,1] == '#' if self.length == 4 return (self[1] * 2 + self[2] * 2 + self[3] * 2).to_i(16).uicolor(alpha) end return self[1..-1].to_i(16).uicolor(alpha) end img = UIImage.imageNamed(self) img && img.uicolor(alpha) end end
Version data entries
29 entries across 29 versions & 1 rubygems