Mandala Palettes

In Mandala, a palette is the name given to a set of five colors that specify the four snake colors and the background color. There are six different palettes in Mandala. They are:

Palette Name

Background Color

Snake Colors (1-4)

Classic

White

Cyan, Magenta, Yellow, Blue

Primary

White

Red, Green, Blue, Yellow

Monochrome

White

Four shades of gray

Inverted

Black

RGB(255,128,255), RGB(0,192,64), RGB(128,0,255), RGB(192,255,0)

Oriental

Red

RGB(255,255,0), RGB(0,192,64), RGB(128,0,255), RGB(128,128,255)

Custom

User set

User set

The current palette is selected from a drop-down list control on the View|Options dialog box. The custom palette snake and background colors can be changed through a second dialog enabled by selecting a button on the main dialog box. The RGB(X,Y,Z) syntax used in the table indicates the values of the red (X), green (Y), and blue (Z) intensity components of the color. A 0 to 255 (8-bit) range is used. Black, for example, would be represented as RGB(0,0,0). White is RGB(255,255,255). Red is RGB(255,0,0).

Combining Colors

The snake colors combine as the snakes move and overlap. Consider a pixel that is set to the background color. A single snake enters the pixel. By definition, the pixel is set to the snake color, regardless of the background color. When the snake leaves the pixel, when the tail finally gets to that point, the color of the pixel will revert to the background color. The situation becomes more interesting when snakes combine with other snakes, including themselves.

At the computer logic level, snake colors are combined with the XOR (exclusive OR) operation. This operation is often used for adding a color contribution to a pixel because a second application of the same operation will restore to the pixel to the original color. Colors are stored as a set of three, 8-bit (0 - 255) values which represent the red, green, and blue intensity. Snake combination colors are computed by XORing the snake colors with the background color. This XOR is applied to each color component, red, green, and blue.

Several interesting results arise from this algorithm.


Last update: Monday, July 30, 2001 03:17:33 PM
Back to the Mandala Home Page