COLOR

Syntax

COLOR number

Explanation

COLOR returns the color setting for the given color number in the current palette. The color setting is a list of three values between 0 and 255. The first value stands for Red, the second value for Green and the third value for Blue.

Windows will try to support every color request made by any program. In 16 color modes, however, all available colors are used up by Windows itself for its array of reserved colors. Therefore, any additional color will be generated as a dithered color. A dithered color is a color made up by painting small patterns of pixels put together by the available colors on the display. Since a dithered color is not a true color, Windows us unable to use these colors for drawing lines. If a request is made to draw a line in a dithered color, the true color that most closely matches the desired color will be used.

On displays with 256 colors and more, Windows has many more chances to match a color request to a true color. If the requested color is unavailable in the current color set used by the display, an existing but unused entry will be altered to reflect the new true color. If all entries are used up, one of the existing entries will be replaced with the requested color, thus slightly altering the color stored there before.

Logo has a total of four palettes available, where each palette contains 256 colors. In 16-color modes, the 16 available colors are repeated all over each palette until each palette is filled. If you want to define a color which does not belong to the set of colors defined, Logo wil lmatch your requested color to the nearest color available, since Logo does not to disturb Windows' own coloring. When Windows makes 256 colors available, Logo will always try to satisfy your color request as good as possible. The color palette will be initialized to the palette Windows generates for 256-color VGA displays.

To change a color, use SETCOLOR. See also PENCOLOR and SETPC.

Examples

The following example assumes that you use color 4 (red) for Logo output, and how to assign different colors to the text that Logo prints.

? COLOR 4

Result: [128 0 0]

? SETCOLOR 4 [0 255 0]

(green)Result: [168 0 0]

(green)?