RubyMotion Tinted Image com CGBlendMode
Inspirado em http://robots.thoughtbot.com/designing-for-ios-blending-modes . class UIImage def tintedImageWithColor(tintColor) UIGraphicsBeginImageContext(self.size) tintColor.setFill bounds = [[0, 0], self.size] UIRectFill(bounds) self.drawInRect(bounds, blendMode: KCGBlendModeHardLight, alpha: 0.8) tintedImage = UIImage.UIGraphicsGetImageFromCurrentImageContext UIImage.UIGraphicsEndImageContext tintedImage endend Em seguida, use-o …
Continuar lendo