We think of colors as the spectrum of the rainbow, but the computer builds up all colors from just three: red, green, and blue. By varying the relative intensity of these three colors the computer can generate all the colors of the rainbow. A Panorama color data item combines red, green, and blue intensity values into a single raw binary data item (see Binary Data).

RGB Color

Macintosh measures color intensity on a scale from 0 (completely dark) to 65,535 (full brightness). Values in between denote intermediate intensity. By combining the three primary colors with different intensities you can create virtually any color. The table below shows a small sample of the colors that are possible.

RedGreenBlueColorSampleHTML
000Black000000
655356553565535WhiteFFFFFF
150001500015000Dark Gray3A3A3A
450004500045000Light GrayAFAFAF
6553500RedFF0000
0655350Green00FF00
0065535Blue0000FF
65535065535PurpleFF00FF
65535655350YellowFFFF00
06553565535Cyan00FFFF
3441427632336Dark Blue0D107E
392353021130211Brown997676
243672335631931Light Green90EE90
65535233562936OrangeFF5B0B

Using Colors

A color in a field or variable is just a piece of data that describes a color… you can’t actually see the color. However, some advanced form objects allow you to control their color using a color data item, and you can look at or modify the color of any graphic object in a form. See changeobjects and objectinfo( for more information.

You can also change the color of Action menu items. See setprocedureoptions and getprocedureoption( for more information.

HSB Color

Another way to specify a color is the HSB, or Hue, Saturation, Brightness system. Like the RGB system, the HSB system uses three numbers from 0 to 65,535 to describe a color. However, the three components have different meanings in this system.

The Hue component specifies where this color falls in the spectrum. If you are familiar with the standard Apple color picker, the Hue would specify the angle of the color from the center of the wheel.

The Saturation component refers to how intense this color is. Is it a very intense deep color, or is it a soft pastel color, or somewhere in between? Again using the standard Apple color picker, the Saturation would specify the distance of the color from the center of the wheel.

The Brightness component refers to how light or dark the color is. Is the color very bright, or is it almost black? This sounds similar to Saturation, but it isn’t. Imagine a blue ball under a white light. As the light gets dimmer, the Hue and Saturation of the color don’t change, but the Brightness does. On the Apple color picker the Brightness is specified by the scroll bar on the bottom.

HTML Color

In Panorama, color values are normally created with the rgb(, hsb( or htmlrgb( functions. For example, the color of an action menu item can be set to red like this:

setprocedureoptions "","Danger Level","MENUCOLOR",rgb( 65535 , 0 , 0 )

Instead of using separate color components you can specify colors using an HTML color specification, like this:

setprocedureoptions "","Danger Level","MENUCOLOR",htmlrgb("FF0000")

An alternative shortcut is to simply use a text string containing the HTML color, like this:

setprocedureoptions "","Danger Level","MENUCOLOR","FF0000"

No function is required, Panorama simply automatically recognizes that a color is required and an HTML color specification has been supplied.

Alpha (Opacity)

An optional color component is opacity. Opacity can vary from 0 (transparent) to 65535 (completely opaque). Note: Some Panorama components, for example menu items, do not support the alpha component, and are always completely opaque.


See Also


History

VersionStatusNotes
10.0UpdatedCarried over from Panorama 6.0, but now includes an optional alpha (opacity) component, as well as automatic recognition of HTML colors without a function.