Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIColor not matching RGB

Tags:

ios

rgb

uicolor

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.

Ideas?

like image 260
Chris Avatar asked Dec 03 '22 13:12

Chris


1 Answers

Sounds to me like your calculations for converting the value from fireworks to the value necessary in UIColor is off.

example:

Fireworks RGB values red:64 green:87 blue:188

divide those three number each by 255

gives you [UIColor colorWithRed:0.250980392156863 green:0.341176470588235 blue:0.462745098039216 alpha:1.0]

like image 125
scottbates22 Avatar answered Jan 15 '23 16:01

scottbates22