Bharat Jagtap
Bharat Jagtap

Reputation: 1692

Facing issue with the RGB color in iPhone?

I am using free online sites to select the RGB color . There are a lots of sites which provides the color picker . I have used at least 4 to 5 sites to check the RGB value.

Issue is I am not able to set the proper RGB values to my controls. It displays right on the website but display very different on iphone/simulator . I am using below method.

  [UIColor colorWithRed:230/255 Green:230/255 Blue:230/255 alpha:1.0];

Is there any difference in the RGB value for web sites and for Xcode or something . . Can someone refer me to the link where I can pick some colors and set the RGB in iPhone .

Upvotes: 0

Views: 1883

Answers (1)

karim
karim

Reputation: 15589

Use,

  [UIColor colorWithRed:230.0/255 green:230.0/255 blue:230.0/255 alpha:1.0];

Mind the integer division in C, when both operands are integer.

Upvotes: 1

Related Questions