Search code examples
iosuicolor

Creating specified UIColor in iOS


I have to create the text color as shown in the picture, can someone help me with the RGB values for the specified colour.

Creating blue color in ios

I tried the following code

[UIColor colorWithRed:(102.0/255.0) green:(204.0/255.0) blue:(255.0/255.0) alpha:1.0];

But i am not able to get the exact color which is expected.

Any help on this will be appreciable


Solution

  • You can use the DigitalColor Meter app in MacOS to find the RGB values. All you need to do is open the app and then just put your cursor on that text or area whose RGB value you wish to find.

    DigitalColor Meter : Either you can get using the search bar or Applications/Utitlies/DigitalColor Meter

    And then please do not use : [UIColor colorWithRed:(102.0/255.0) green:(204.0/255.0) blue:(255.0/255.0) alpha:1.0];

    Instead use the actual values like : [UIColor colorWithRed:0.5058 green:0.7725 blue:0.9176 alpha:1.0];

    Finding RGB values using DigitalColor Meter app in MacOS