uicolor

How can I load an image in my resources folder?

I have an image in my iPhone Project. It's a PNG and I can set the background in Interface Builder but I want to do this programatically. NSLog(@"Before %@", myEasterEgg); uiImageBackground.backgroundColor = [UIColor purpleColor]; myEasterEgg = [myEasterEgg stringByAppendingString:@"5"]; NSLog(@"After %@", myEasterEgg); if (CFStringComp...

Memory leaks in UICOLOR color with RGB method

Hi, I have to token the string and get a RGB values to make a UICOlor, below is the code, NSString* text = @"1.0,1.0,1.0"; NSArray *chunks = [text componentsSeparatedByString:@","]; return [UIColor colorWithRed:([[chunks objectAtIndex:0] floatValue]/256.0) green:([[chunks objectAtIndex:1] floatValue]/256.0) ...

UIColor comparison

Given a UIColor, I need to determine if it is "light" or "dark". If I could access the hex value of the color, I could just check if it was greater than or less than a certain threshold hex number, but there appears to be no way to do that. Is there? Or is there another way I could check the brightness value of a UIColor? ...

UISlider to represent the color spectrum

I have a UISlider that is supposed to update the color of a textlabel. Now I want the user to be able to choose between all colors in the spectrum (sort of all anyway). I was thinking of using this UISlider to represent the colors and when dragging the slider the value/color changes. I know the spectrum is not sequential like: [0,0,0].....

NSForegroundColorAttributeName key in iPhone.

Hi All, I heard that NSAttributedString is added in iPhone but when I use the key NSForegroundColorAttributeName for setting the color i get an error saying "NSForegroundColorAttributeName undeclared". Am I missing anything? Please help me. Regards Yallappa ...

UIBarButton does not have a 'press' animation

I have a UIView that I am loading and it has a navigation bar with a 'Done' barButton. When I leave the navigation bar the default color, everything is fine. When I make it have a black tint, the 'Done' button works fine but it does not have the pressing animation that buttons usually have. It doesn't look as thought the button is bei...

What's making NSArray access so slow?

I'm working up a graphics effect for an iPhone app that simulates a low-res plasma effect from old demoscene days. I've got 600 squares on screen that are updating as fast as possible. Since I am using CoreGraphics (for now), I can get a very constant 11FPS with no freezing-- BUT when I try to add one simple NSArray lookup, the iPhone a...

How to convert HEX RGB color codes to UIColor?

I have an RGB hex code like #ffffff as NSString and want to convert that into an UIColor. Is there a simple way to do that? ...

UILabel backgroundColor in UITableViewCell always reverts to initial value

In my app, I have a UITableViewCell which is used to display a background color setting. In the detailTextLabel, it displays the name of the color with the background set to the actual color, e.g. [UIColor cyanColor]. Note that I am setting the background of the detailTextLabel only, not the whole UITableViewCell. When users tap on the c...

Iphone development: UIColor / CGColor components comparison

Hello, I've got some internal codes for colors in my application, so I created a function that, given a color, returns the code. I'm having problems as it just doesn't work and return always "01" for every color else than the red, which returns the proper code. Has someone a clue about it? (NSString *)internalColorCode:(UIColor *)color ...

Why is my CGGradient not working with a preset UIColor?

I have this working code: NSMutableArray *shadowColors = [NSMutableArray arrayWithCapacity:2]; color = [UIColor colorWithRed:0 green:0 blue:0 alpha:1]; // Declaration using components [shadowColors addObject:(id)[color CGColor]]; color = [UIColor colorWithRed:1 green:1 blue:1 alpha:0.0]; // Declaration using components ...

Background image in view controller result in memory increase + UIColor colorWithPatternImage

I tried 2 different methods of creating a background image for a view controller. I have researched this before and came to the conclusion that for good memory practice you should use this method: NSString *path = [[NSBundle mainBundle] pathForResource:@"controllerBackground" ofType:@"png" inDirectory:@""]; [self.view setBackgroundCol...

how can i apply UIColor to existing image ?

i have a1.png image. i wants to apply red/green/any color on that image. can anyone has solution ?? ...

UISegmentedControl gives different background then single UIBarButtonItem

Hi, In my Ipad app i started with a single UIBarButtonItem at the right: That + picture is just white. self.switchView.navigationItem.rightBarButtonItem = nil; UIBarButtonItem *rightButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"add.png"] style:UIBarButtonItemStylePlain target:self action:@selector(insertKnoopPr...

What is the color used in Table View section head / footer text?

This muted blue grey color is all over the place, and I can't find a convenience color that looks even remotely close. Clearly I'm missing something obvious... I'm trying to "fake" a stock look for a UIView that is my section footer for a UITableView. Has anyone else had any luck? My UILabel will also need a white drop shadow. ...