With fast, is it possible to access the inverted colors feature available?
2 answers
I don't know how to do this automatically, but can you invert the colors yourself using an extension on UIColor and accessing subviews?
extension UIColor {
var inverted: UIColor {
var r: CGFloat = 0.0, g: CGFloat = 0.0, b: CGFloat = 0.0, a: CGFloat = 0.0
UIColor.red.getRed(&r, green: &g, blue: &b, alpha: &a)
return UIColor(red: (1 - r), green: (1 - g), blue: (1 - b), alpha: a) // Assuming you want the same alpha value.
}
}
And if you want to update certain properties of the views, you can do something like this:
view.subviews.map { $0.backgroundColor = $0.backgroundColor.invertedColor }
// And so on to change things like the tint color, text color, etc.
Sorry I don't know how to do this directly, but until then this is better than nothing I think.
+2
source to share