I'm working on UIImageView with Labels and TextFields. In my scenario, how can I change the label text color based on background image?
For Example : My Background image white, in that scenario the label text color is black or red except white.
Please help me. Thanks in Advance.
Just engineering of answers found online:
Calculate average color for your background image: how to find average color of image
Calculate an inverted color for the found color: inverting a UIColor
Set label.textColor
to a result color
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.