FAQ Database Discussion Community

Using CIColorMatrix filter in Swift

The following Swift func is supposed to tint a greyscale image 'greyImage' using specified 'tintColor': import UIKit func colorizeImage(greyImage : UIImage, tintColor : UIColor) -> UIImage? { let colorMatrixFilter = CIFilter(name: "CIColorMatrix") var r:CGFloat = 0 var g:CGFloat = 0 var b:CGFloat = 0 var a:CGFloat = 0 tintColor.getRed(&r, green:&g,...

Apply ColorFilter / ColorMatrix to turn image completely white

I have a circular ProgressBar on my Toolbar to show some indeterminate progress happening, however the default style of the ProgressBar (the only one I know that makes it into a circular ring) is the same color as the toolbar (the 'colorPrimary' color). The styles I tried are ?android:attr/progressBarStyleLarge and...