Skip to content

Color Table

The-Nice-One edited this page Jun 11, 2026 · 2 revisions

Stores RGBA color values that can be referenced by pixmap data.

Use Cases

  • Pixmap palettes - When linked to a Pixmap Table, provides the color palette for indexed pixel data.
  • Color storage - Can store color sets independently for other purposes.

Table Structure

Identifier

  • Value: 0x03

Modifier Flags

Bit Name Description
0 use_color_type Each record includes a color_type field indicating the color mutability type.
1-7 Reserved for future use.

Flag Details

  • use_color_type: When disabled, the default color type is dynamic. The rendering engine may change the RGBA color to support features such as, but not limited to; text color, and/or palette theming.

Configuration Flags

Bit Name Description
0 use_constant_alpha All colors in this table share the same alpha value.
1-7 Reserved for future use.

Configuration Values

Name Type Condition Description
constant_alpha u8 If use_constant_alpha is enabled. The alpha channel value applied to all colors in this table.

Record Fields

Each record contains the following fields in order:

Field Type Condition Description
color_type [TYPE_PLACEHOLDER] If use_color_type modifier is enabled. Color Type value (0 = Dynamic, 1 = Absolute).
alpha [TYPE_PLACEHOLDER] If constant_alpha configuration is not set Alpha channel value (0 = fully transparent, 255 = fully opaque).
red [TYPE_PLACEHOLDER] Always present Red channel value.
green [TYPE_PLACEHOLDER] Always present Green channel value.
blue [TYPE_PLACEHOLDER] Always present Blue channel value.

Record Layout Examples

Example 1: Minimal record (no modifiers or configurations)

Byte layout:  [red] [green] [blue]
Binary:       11111111 00000000 10101010
Hex:          FF       00       AA
Color:        rgb(255, 0, 170) - fully opaque magenta

Example 2: With custom alpha (constant_alpha not set)

Byte layout:  [alpha] [red] [green] [blue]
Binary:       10000000 11111111 11111111 11111111
Hex:          80       FF       FF       FF
Color:        rgba(255, 255, 255, 128) - 50% transparent white

Example 3: With all optional fields

Byte layout:  [color_type] [alpha] [red] [green] [blue]
Binary:       00000001 11111111 00000000 00000000 00000000
Hex:          01       FF       00       00       00
Color:        rgba(0, 0, 0, 255) - absolute black (cannot / should not be modified by renderer)

Complete Table Example

The following byte sequence defines a minimal table with example records:

Byte(s) Binary Hex Description
1 [BINARY_PLACEHOLDER] [HEX_PLACEHOLDER] Table identifier
... ... ... [DESCRIPTION_PLACEHOLDER]

Clone this wiki locally