Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hex code for clear color

My ques may be silly. Is there an hexa code for [UIColor clearColor]? If so, what is the code? Thanks in advance.

like image 590
iOS Avatar asked Dec 04 '22 19:12

iOS


2 Answers

RGBA Hex Code for ClearColor: NNNNNN00 whereas N may be any hex-value (0-F).

like image 94
Till Avatar answered Dec 22 '22 02:12

Till


UIColor *clearColor = [UIColor clearColor];
CGFloat red = 0; 
CGFloat green = 0; 
CGFloat blue = 0; 
CGFloat alpha = 0; 

[clearColor getRed:&red green:&green blue:&blue alpha:&alpha];

NSLog(@"red: %.3f, green: %.3f, blue: %.3f, alpha: %.3f",
red, green, blue, alpha);

NSLog(@"red: 0x%02x, green: 0x%02x, blue: 0x%02x, alpha: 0x%02x",
      (int)(red*255.0), (int)(green*255.0), (int)(blue*255.0), (int)(alpha*255.0));

NSLog output:

red: 0.000, green: 0.000, blue: 0.000, alpha: 0.000
red: 0x00, green: 0x00, blue: 0x00, alpha: 0x00
like image 23
zaph Avatar answered Dec 22 '22 02:12

zaph