Those RGB numbers
This is a follow-on question to my recent post concerning properties of windows.
The Terminal Inspector allows for setting colors of a Terminal window(s). if I set the background color to a specific "crayon" color, then get properties of the window, the background color listed is (for example): {-1, -13108, 26214}
If I then run "choose color" and select the same crayon, I get: {65535, 52428, 26214}
I'm wondering what the negative numbers mean, and why there is this discrepancy.
Red_menace pointed out to me that a fourth number addresses transparency. If, with Terminal Inspector, I set transparency to about 50%, that fourth number does appear in the properties. In this case: -27441 (again a negative number)
Ignoring that my Terminal Dictionary claims background color is a string, if I run this script:
tell application "Terminal" to set background color of window 1 to {R,G,B}, either of the color sets above yields the same result.
And, if I add a fourth number [as in {R,G,B,Trans}], I can use the same script to control transparency as well as color -- but the numbers for "Trans" needed for different transparency results throws me. Examples:
{-1, -13108, 26214, 0} yields 100% transparency
{-1, -13108, 26214, -1} seems to yield 0 transparency
{-1, -13108, 26214, -10000} yields about 50% transparency
and so on (I won't even talk about postive numbers)
I guess my question is: are there any rules to this?
The Terminal Inspector allows for setting colors of a Terminal window(s). if I set the background color to a specific "crayon" color, then get properties of the window, the background color listed is (for example): {-1, -13108, 26214}
If I then run "choose color" and select the same crayon, I get: {65535, 52428, 26214}
I'm wondering what the negative numbers mean, and why there is this discrepancy.
Red_menace pointed out to me that a fourth number addresses transparency. If, with Terminal Inspector, I set transparency to about 50%, that fourth number does appear in the properties. In this case: -27441 (again a negative number)
Ignoring that my Terminal Dictionary claims background color is a string, if I run this script:
tell application "Terminal" to set background color of window 1 to {R,G,B}, either of the color sets above yields the same result.
And, if I add a fourth number [as in {R,G,B,Trans}], I can use the same script to control transparency as well as color -- but the numbers for "Trans" needed for different transparency results throws me. Examples:
{-1, -13108, 26214, 0} yields 100% transparency
{-1, -13108, 26214, -1} seems to yield 0 transparency
{-1, -13108, 26214, -10000} yields about 50% transparency
and so on (I won't even talk about postive numbers)
I guess my question is: are there any rules to this?
2.7G5 AND OTHERS, Mac OS X (10.4.6)