uicolor

Can I tag a UIColor?

Can I tag a UIColor that is constantly changing values for easy access from methods? ...

UIColor not matching RGB

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.0. I am trying to get a dark blue color, the UIColor is giving me a very light blue. ...

How to save custom color to UserDefaults

I am trying to use some non-standard colors (i.e. not UIColor blueColor, but a darker blue color, a darker green, red...etc...) and when I try to save the user selected UIColor object to UserDefaults, it is failing. Below is the code I am using to create the custom colors, followed by the code to save the UIColor objects to the UserDefau...

UIColor Function Crashes

Okay, so I have a UITableView that I want to apply themes to. I think I've figured out how to do it. What I do is when my view loads, I call a function called "[self getValues]". Here is how it looks: - (void)getValues { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSString *theme = [defaults valueForKey:@"...

UITextView refuses to change its color

Hello, in some cases things you'd expect to solve within a sec turn out to become a lifetime adventure. This is one of these cases :) All I wanted to do, is simply change the text color of one of my UITextViews. So far I tried: UIColor *myColor = [UIColor colorWithHue:38 saturation:98 brightness:100 alpha:1.0]; [myTextView setTextColo...

How to programmatically change UIColor of view

Okay, this question comes through a friend so it might be lost in translation... Basically we need to change the color on a View. It appears to be stored in NSString format, but using a NSString to set the UIColor doesn't seem to do anything. In other words, if NSString color holds the value "redColor" then: self.view.backgroundColor =...

Can not change UILabel text color

Hi, all I want to chang UILabel text color,but can't change it's color,This is my code. UILabel *categoryTitle = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 46, 16)]; categoryTitle.text = @"abc"; categoryTitle.backgroundColor = [UIColor clearColor]; categoryTitle.font = [UIFont systemFontOfSize:12]; categoryTitle.textAlignment = UI...

Why can't I set a custom color-tint for the UINavigationBar?

I want to change the color on the navigation bar and the documentation states not to attempt to change the 'alpha' value. So, how can I set a color that is not the SDK defined values (e.g., [UIColor redColor], brownColor, etc.) if all the constructors provide an alpha value? I tried getting the current alpha value but that did not help...

How do I define constant values of UIColor?

I want to do something like this, but I cannot get a cooperative syntax. static const UIColor *colorNavbar = [UIColor colorWithRed: 197.0/255.0 green: 169.0/255.0 blue: 140.0/255.0 alpha: 1.0]; I suppose that I could define macros, but they are ugly. ...

How to access the CGColor property of UIColor in CGContextSetFillColorWithColor?

CGContextSetFillColorWithColor(g, [UIColor greyColor].CGColor); I'm trying to follow O'Reilly's iPhone Game Development book on page 73 Chapter 3 but I'm running into a compile error that states error: request for member 'CGColor' in something not a structure or union According to the book's errata page this is an unconfirmed errata ...

How to determine UINavigationBar custom view text/shadow color for different styles in UISplitViewController?

I have a splitview with a pop over master view using UINavigationController. The problem is I have some custom text views in the header of the nav controller and when it switches to the pop-over view the style of the nav bar changes. This makes the colors of the text clash since they are no longer using the correct settings for the new n...

Make an iPhone InfoButton light/dark based on color behind it

How do I detect what color is under the InfoButton... so I can change the button from DARK to LIGHT? I set my view's color... but how do I tell if it's "kind of light" or "kind of dark"? Besides... I can't change the info-button from light to dark anyway. (read only) Ugh. Shouldn't Apple have some kind of a simple "cmdButton.doThisE...

Crashing while passing UIColor as argument

I have a little UIView object, CircleColorView.m, that simply creates a view with a colored circle in it. I then use that view as the background to a bunch of buttons (all different colors). My problem happens when the drawRect: method gets called. I crash, but only sometimes, when I reference the object color which is a UIColor. I am...

How do I add a background tint to the outside of the UISearchDisplayController table view?

In my view controller, when I instantiate my UISearchDisplayController object, I set its various properties, including the background color of the searchResultsTableView property: self.searchDisplayController = [[[UISearchDisplayController alloc] initWithSearchBar:searchBar contentsController:self] autorelease]; searchDisplayController....

colorWithPatternImage with iPhone 4 Retina Display ([email protected])

Thanks to SO's search function blowing up whenever I enter "@2x", it's difficult to tell whether this has already been asked... I've been using colorWithPatternImage: to build tiled background images for my various views. However, these predictably look like trash when viewed on the new iPhone 4 display. So I've built @2x versions of ...

changing the colour of Button

how can I change the button colour when ever I click that button please help me out ...

How do I get the value (float) for RG & B of a UIColor object?

Hello, I have created a UIColor object and want to set the colors before drawing using CGContextSetRGBStrokeColor. In order to do that I need to extract the values of red, green and blue from the UIColor object. How do I do that? Or is there perhaps a better way defining the color using some other kind of methods (couldn't find when ...

change background color of a section header title (normal tableview)

hi, My app looks just like the default address book app on iphone. For each alphabet there is a section header in the address book( A, B . .) in gray gradient background color. Is it possible to override that default color to some other tint color ? ...

Use an image as the UITableView separator

I got an UITableView on my project and I need to customize the separator. I want to use an image instead of a color. I tried using the +colorWithPatternImage: UIColor method with no luck. ...

JMenu and JMenuItems have thin orange border that I cannot change

Hey all, I have been using the UIManager to change the coloring scheme on my GUI. For example I use this for JMenuItems: UIManager.put("MenuItem.foreground", new ColorUIResource(255, 255, 255)); UIManager.put("MenuItem.background", new ColorUIResource(51, 51, 51)); UIManager.put("MenuItem.selectionBackground", new ColorUIResource(232, ...