Is it possible to detect the colour of a particular UILabel programatically?
The intention for these lines of code, is to change the background from a red colour, to a white colour. Increase the brightness for a brief second then reduce the brightness and follow up with a label background colour back to red.
The issue is that sometimes, the brightness will increase without the background colour changing. Thus resulting in a major flaw in the design for the application. Which is private.
self.label.backgroundColor = [UIColor colorWithRed:255.0/255 green:255.0/255 blue:255.0/255 alpha: 1.0];
[UIScreen mainScreen].brightness = 1.0;
[self performSelector:@selector(resetColor) withObject:self afterDelay:0.05f ];
- (void)resetColor {
[UIScreen mainScreen].brightness = 0.0;
self.label.backgroundColor = [UIColor colorWithRed:255.0/255 green:0.0/255 blue:0.0/255 alpha:0.5];
Can anyone see why it would randomly not change the background colour beforehand?
And mainly, is it possible to do the following?
if (self.label.backgroundColor == [UIColor whiteColor]){
or
while (self.label.backgroundColor == [UIColor whiteColor){
?