How can I set UIcolor to have a deepblue values (like 330099, shown in interface builder) programmatically?
To create a UIColor based on RGB values you need to do:
[UIColor colorWithRed:0x33/255.0 green:0 blue:0x99/255.0 alpha:1.0]
Just use Jeff LaMarche's UIColor extensions....
You can see how it is done.
Or in stead of using 0x33 / 255.0 use the actual float for the color value, this of course requires you to convert the values.
[UIColor colorWithRed:51.0 / 255.0, green:0.0, blue:153.0 / 255.0];
As long as you use a floating point value in your division you don't have to cast anything. Make sure you use floating point values. For example:
33 / 255 = 0. Which will become black.
Here is the best tool I have found yet! You can even set a hex color and have it auto generate the UIColor code for you.