This is more of a IB question. In IB have have used the color dialog to pick a color for the background of my view. Now I want to create some HTML content that uses the same color. In the IB I figured I could see the RBG values for the color. But I can't seem to find that. Alternatively, how can I take the backGround color of the view and print out the RGB values?
I don't know the answer to your question directly, since I have completely failed to master Interface Builder - it's been much easier for me to create my interface elements in code.
If I want to match a UIColor like [ UIColor redColor ] to a HTML color, I'll do this:
- Take a screen shot of my application, showing the color.
- Pull up Grab or your favourite screen capture utility. (There's one built into the OS that doesn't need grab, but I can never remember the cryptic key sequence needed to run it).
- Make the screen capture and Edit/Copy it
- Paste it into Photoshop or your favourite image editor.
- Use the eyedropper tool to pick the color.
- Pull up the color picker. In Photoshop, you will see the hex color on the lower corner of the picker, right next to the color well.
I know it's a bit eccentric but it does work. I think you can use Photoshop Elements if you can't afford Photoshop
Just use DigitalColor Meter (found the Utilities directory on your Mac). No need to take a screen shot - just start it up and hover over the color you need to know the hex values for.
In case anyone was looking for how to set a UIColor to an RBG value (like I was), it is done like this:
Use DigitalColor Meter in your utilities folder and get the RGB as Percentage value of the color on your screen then use the values as decimals like this: