How to set UIcolor to deep blue

How can I set UIcolor to have a deepblue values (like 330099, shown in interface builder) programmatically?


-------------Problems Reply------------

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....

and here:

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.

Category:iphone Views:0 Time:2009-05-20

Related post

  • i installed windows 7 deep blue on my windows 7 home premium laptop and cannot access any of my backed up programs 2013-09-26

    i installed windows 7 deep blue on my windows 7 home premium laptop and cannot access any of my backed up programs --------------Solutions------------- What do you mean by "deep blue" and what do you mean by "backed-up programs"? If you find my respo

  • Sanyo SCP-2700 Deep Blue Cell Phone 2012-02-29

    I have a Sanyo SCP-2700 deep blue cell phone. I was out fishing on a small fishing boat and an unexpected storm hit.. My phone was in a ziplock bag but from the boat filling with water from huge white caps, it got soaked with water. I put my phone in

  • Windows 8 style apps launch to deep blue screen 2013-11-06

    I have an Asus N43SN, with Intel Core i7 2630QM, 8 gigabytes of memory, nVidia 550m + Intel GMA 3000 using nVidia Optimus technology and 120 GB SSD drive. I enjoy using genuine Windows 8 Pro, but I've been experiencing a problem recently, though I'm

  • Using [UIColor colorWithRed:green:blue:alpha:] doesn't work with UITableView seperatorColor? 2011-04-12

    I'm trying to configure a dark gray seperator color. Why does the following do nothing? self.tableView.seperatorStyle = UITableViewCellSeperatorStyleSingleLine; self.tableView.seperatorColor = [UIColor colorWithRed: 127 green:127 blue:127 alpha:1]; r

  • UIColor -initWithRed:green:blue:alpha: memory leak? 2011-11-06

    I have this situation: UIColor *color = [[UIColor alloc] initWithRed:0/255.f green:156/255.f blue:255/255.f alpha:1]; self.lightBlue = color; color = nil; [color release]; And receive memoery leak in UIColor *color = [[UIColor alloc] initWithRed:0/25

  • Weird arguments in UIColor colorWithRed:green:blue:alpha: 2011-04-12

    When checking this method, I was expecting for red, green and blue to be in the 0-255 range. Instead, it's in 0-1. Am I the only one who thinks this is weird? Is there any reason not o use the more common 0-255 values for RGB, or even hex numbers (as

  • screen deep blue vertical lines when vewing certain web pages 2012-06-18

    i get dark blue vertical lines when viewing certain web pages with lots of graphics, i have changed my video card and power supply but to no avail. have run system in 16 bit graphics mode. some one please help me out here? thank you so much, john sys

  • Sanyo SCP-2700 Deep Blue Cell Phone pc compatible 2012-11-05

    My cell phone wont download music from my computer or pics. Can anybody help me with this? --------------Solutions------------- Hardware support comes from the hardware device manufacturer. Your case: Sanyo. Sanyo SCP-2700 User Guide Support specific

  • Sanyo SCP-2700 Deep Blue Smartphone 2014-03-27

    cannot get phone to connect to windows 64 or 32 bit, say's not compatible --------------Solutions------------- Since the phone is over three years old it is likely no longer supported by Sanyo. You could ask them or check their web site, it's up to t

  • UIColor not matching RGB 2010-02-24

    I have an image in Fireworks. I am using the picker to choose the color and then look at the RGB values. I am putting these values into UIColor:colorWithRed:green:blue:alpha but it is not giving me the same output. I am using values between 1.0 and 0

  • Comparing UIColors or CGColor or CGColorSpace 2011-05-22

    I'm having an issue comparing UIColors. I have an image, which I have successfully extracted the color on the image at which the user clicked. Now I want to compare that color with other colors, but I'm getting some strange results. Here's what I've

  • How can i set a light blue back ground color to my UITableView cell? 2011-06-15

    Possible Duplicate: How can I set a cell on the iPhone as a custom color? i need to set a light orange back ground color to my UITableView please any one help me to do it.i used the following code to get green please help me to do it

  • Various blue screens that started up at the same time. 2012-06-29

    Hello All, myself and my brother recently built own PCs for use with film editing. We are very proud of our first homemade computers and made them out of top of the line parts. After about 6 months of existence and operation my computer (AKA Deep Blu

  • "Black" and "blue" screens. 2015-02-16

    I'm using an Acer Aspire M1641 with a Dual core at 2.20GHz and 2814RAM. I'm using Vista Home Premium. It's a fairly new computer, about a year old now, but it has already given me a whole bunch of problems. Apart from the slightly-more-than-occasiona

  • How to change the border color below the navigation bar? 2011-07-25

    Can anyone advise me on how the border below the navigation bar can be changed? I would like to change it from the current black light to a softer color. Appreciate any help here --------------Solutions------------- I do not think there is a method t

  • How can I use no color-theme under console-mode? 2008-11-09

    I use the dark-blue2 color theme but it seems ugly under console. So I want to use no color theme under terminal, what can I do then? --------------Solutions------------- Set a "TERM" variable corresponding to a monochrome terminal before launching E

  • Is there a perfect algorithm for chess? 2008-11-18

    I was recently in a discussion with a non-coder person on the possibilities of chess computers. I'm not well versed in theory, but think I know enough. I argued that there could not exist a deterministic Turing machine that always won or stalemated a

  • What is the state of the art in computer chess tree searching? 2009-02-07

    I'm not interested in tiny optimizations giving few percents of the speed. I'm interested in the most important heuristics for alpha-beta search. And most important components for evaluation function. I'm particularly interested in algorithms that ha

  • Good text foreground color for a given background color 2009-06-03

    I'm drawing a color selection button and I'm looking for a nice and simple formula to get a good text color (foreground) for a given background color in RGB. A simple try would be to just take the complement color but this will produce an odd looking

Copyright (C), All Rights Reserved.

processed in 0.166 (s). 11 q(s)