Command Reference: COLOR.* Command Family
About the COLOR.* Commands
Commands in this family exist to help you use and manipulate colors. Each color's value is represented by a group of three bytes: one for Red, another for Green, and a third for Blue. Together, these channels produce the colors in your images.
Important: internally, colors are not stored in the familiar RGB order. This means that specifying colors using hexadecimal values will not work as expected. To get around this limitation, always create a new color value using the COLOR.NEW command or the IMAGE.GETPIXEL command instead of attempting to hard code a value.
The COLOR.* Commands
COLOR.NEW 0x?????? nCOLOR.NEW Red Green Blue
This command creates a usable color value by translating the provided values into the same order that's used internally. You can use either a six digit hexadecimal value, as in HTML or CSS, or three decimal values to set the color's channels individually. The new color value is stored in .RESULT .
COLOR.AVERAGE Color
This command creates a new color value using the average intensity of the given color's channels. In other words, it returns the grayscale version of a color.
COLOR.RED Color COLOR.GREEN Color COLOR.BLUE Color
These commands simply return the value of a color's Red, Green, or Blue color channel.