Question

I am new to iOS,

I Want CGFloat value of this image when i enter this values,

static const CGFloat colors [] = { 
    0.3, 0.2, 1.0, 0.8, 
    0.3, 0.3, 1.0, 1.0
};

i am getting output like this, I did lot of researching but didnt success, can any one help me out for finding CGFloat value for my 1st image..

Any help will be appriciated.

Was it helpful?

Solution

If you want the RGB values, then use DigitalColor Meter or Pixie, and point to the view. You will get the RGB values.

You can start DigitalColor Meter from Spotlight.

EDIT:

First you need to get the RGB values. Now in your array, put the RGB values with each value divided by 255.0

The last value is alpha value, which varies from 0.1 to 1.0 and depends on how much transparent you want your view to be.

Thus if your RGB values are 139, 162, 200. The values you will provide to the array are

139.0/255.0, 162.0/255.0, 200.0/255.0, 1.0.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top