This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 0.54 KB  |  views: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. UIButton color change
  2. myButton.backgroundColor = [UIColor brownColor];
  3.        
  4. myButton.backgroundColor = [UIColor colorWithHue:1.0/12 saturation:2.0/3 brightness:4.0/10 alpha:1];
  5.        
  6. UIColor *color = UIColor.brownColor;
  7. CGFloat hue, saturation, brightness, alpha;
  8. [color getHue:&hue saturation:&saturation brightness:&brightness alpha:&alpha];
  9. brightness *= .8;
  10. UIColor *darkerColor = [UIColor colorWithHue:hue saturation:saturation brightness:brightness alpha:alpha];
  11.        
  12. UIColor *myColor = [UIColor colorWithRed:0.5f green:0.5f blue:0.5f alpha:1.0f];
clone this paste RAW Paste Data