-4

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.

Krunal
  • 6,440
  • 21
  • 91
  • 155
  • 3
    I don't understand the question at all. What exactly are you trying to achieve here? – JustSid Nov 08 '12 at 09:27
  • 2
    I didn't get anything either – Evol Gate Nov 08 '12 at 09:27
  • I think he means the gradient values in RGBA. – yinkou Nov 08 '12 at 09:29
  • in my code, what values should i write ? so i will get my required color in output, color of first image is my output... in short i want cgfloat values of first image. – Krunal Nov 08 '12 at 09:32
  • 1
    Still not getting the question. – Ken Nov 08 '12 at 09:37
  • i want CGFloat color value of my first image.. what values should i write in my code ? – Krunal Nov 08 '12 at 09:46
  • Please give *a lot* more detail than that. Nobody understands what you want. More code would also help. I suspect the "image" you're talking about is not a `UIImage`, but something else. What is it? Tell us, and show us the code, or we won't be able to help. – fzwo Nov 08 '12 at 10:07
  • forget about `UIImage`.. i just want CGFloat color code of that 1st image – Krunal Nov 08 '12 at 10:26
  • see my code... is it CGFloat color code ? i just stolen this code from internet.. – Krunal Nov 08 '12 at 10:55
  • You obviously don't even know what you want, and you're unwilling to help. I'd recommend reading a good book about Objective-C and Cocoa Touch. – fzwo Nov 08 '12 at 11:37

1 Answers1

2

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.

footyapps27
  • 3,982
  • 2
  • 25
  • 42