How to get a green to show up like the charging battery on the iPhone lock screen?

Posted by tarheel on Stack Overflow See other posts from Stack Overflow or by tarheel
Published on 2012-12-01T17:02:58Z Indexed on 2012/12/01 17:03 UTC
Read the original article Hit count: 207

Filed under:
|

I am trying to get a color to show up on screen just like the charging battery (shown here):Charging Battery

After looking at the Apple Documentation on UIColor here, I have attempted using both colorWithHue:saturation:brightness:aplha: and colorWithRed:green:blue:alpha: to get a color to show up like that.

For example when I use colorWithHue:.3 saturation:.84 brightness:1 alpha:.5 on a black background, it renders a color like this:

myGreen with colorWithHue:saturation:brightness:alpha:

or the colorWithRed:0 green:1 blue:0 alpha:.5 on a black background shows up like this:

myGreen with colorWithRed:green:blue:alpha:

It doesn't have that translucent or glossy look to it.

Is there a better method to use? Or do I just not have the values right? (I have tried many combinations)

© Stack Overflow or respective owner

Related posts about ios

Related posts about uicolor