Showing posts with label RGB. Show all posts
Showing posts with label RGB. Show all posts
Monday, March 15, 2010
Interface Builder cannot change UIView color
If you fail to change UIView color in Interface Builder, it could be because Emulator is blocking your changes. Close emulator and try again.
Thursday, February 4, 2010
How to Use RGB Values to Show a Non-white Color
This one was really annoying! In every other system I've used, and there's a few, RGB color values (Red - Green - Blue) were from 0 to 255.
iPhone RGB values are from 0 to 1. Using something like (0, 0, 255) gives no warnings what-so-ever. Just silently accepts whatever values you give it and happily tries its best to show you - WHITE !!!
As a sample, here's beige color:
Please note that alpha value 0 (zero) means transparent. If your alpha is 1 (one), you will see color of object below your component, regardless whether you used correct RGB values or not.
That wasn't happy debugging at all.
iPhone RGB values are from 0 to 1. Using something like (0, 0, 255) gives no warnings what-so-ever. Just silently accepts whatever values you give it and happily tries its best to show you - WHITE !!!
As a sample, here's beige color:
myView.backgroundColor = [UIColor colorWithRed:0.96 green:0.96 blue:0.86 alpha:1];Please note that alpha value 0 (zero) means transparent. If your alpha is 1 (one), you will see color of object below your component, regardless whether you used correct RGB values or not.
That wasn't happy debugging at all.
Subscribe to:
Posts (Atom)