RGB returns only BLACK!

The line;

+set background color of cell y of row x to {255, 255, 153} as RGB color+

should produce an orange colour but whatever I change the values to it alays makes the background color black! What am I missing here?

Peter H

iMac 27" 3.06 GHz Intel Core 2 Duo, Mac OS X (10.6.5)

Posted on Jan 1, 2011 4:59 AM

Reply
5 replies

Jan 1, 2011 11:33 AM in response to PeterRHawkes

I guess that it would be a good idea to run this script:

--

tell application "Numbers" to tell document 1 to tell sheet 1 to tell table 1
get background color of cell y of row x (* double check because I am accustomed to use x for the column, y for the row *)
end tell
--


With orange, on my machine it returns {65021, 39578, 0}

{255, 255, 153} isn't black but an heavy gray.

Apple use the same scheme to define colors for years. Each component may have values from 0 to 65535.
Black is : {0, 0, 0}
White is : {65535, 65535, 65535}
None is : missing value

Yvan KOENIG (VALLAURIS, France) samedi 1 janvier 2011 20:33:28

Jan 1, 2011 3:13 PM in response to PeterRHawkes

Apple uses RGB codes; they are not just for Windows. If you open the color chart and look at web safe colors, RGB codes are next to the color swaths. {255,255,153} = FFFF99 and is a yellowish color. You can also pick colors by RGB sliders. {255,255,153} is apparently also {65535,65535,39321}. It seems that the color codes you need to use in AppleScript are 257x the RGB values. This would lead you to believe that you have the ability to pick 65,536^3 = 2.8E14 different colors. Whether that is the case or not, there are unlikely to be any output devices that could handle that fineness of color differentiation.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

RGB returns only BLACK!

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.