Skip to content

Color Table

The-Nice-One edited this page Aug 3, 2026 · 6 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

BitNameDescription
0use_color_typeEach record includes a color_type field indicating the color mutability type.
1-7Reserved 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

BitNameDescription
0use_constant_alphaAll colors in this table share the same alpha value.
1-7Reserved for future use.

Configuration Values

NameTypeConditionDescription
constant_alphau8If use_constant_alpha is enabled.The alpha channel value applied to all colors in this table.

Table Links

BitNameDescription
0-7Reserved for future use.

The Color Table links to no other table. The byte is still written, as 0x00.

Record Fields

Each record contains the following fields in order:

FieldTypeConditionDescription
color_typeu8If use_color_type modifier is enabled.Color Type value (0 = Dynamic, 1 = Absolute).
custom_alphau8If constant_alpha configuration is not setAlpha channel value (0 = fully transparent, 255 = fully opaque).
redu8Always presentRed channel value.
greenu8Always presentGreen channel value.
blueu8Always presentBlue channel value.

Record Layout Examples

Example 1: Minimal record

No modifier flags, and use_constant_alpha enabled so the table supplies alpha.

ByteFieldBinaryHexDescription
1red11111111FFRed = 255
2green0000000000Green = 0
3blue10101010AABlue = 170

Result: rgb(255, 0, 170), a magenta taking its alpha from constant_alpha.

Example 2: With custom alpha

use_constant_alpha is not set, so every record carries its own alpha.

ByteFieldBinaryHexDescription
1custom_alpha1000000080Alpha = 128, roughly 50%
2red11111111FFRed = 255
3green11111111FFGreen = 255
4blue11111111FFBlue = 255

Result: rgba(255, 255, 255, 128), a 50% transparent white.

Example 3: With all optional fields

use_color_type enabled and no constant_alpha set.

ByteFieldBinaryHexDescription
1color_type00000001011 = Absolute
2custom_alpha11111111FFAlpha = 255, fully opaque
3red0000000000Red = 0
4green0000000000Green = 0
5blue0000000000Blue = 0

Result: rgba(0, 0, 0, 255), an absolute black that a renderer should not recolor.

Complete Table Example

The following byte sequence defines a two-entry palette with a shared alpha, one dynamic color and one absolute color:

BytesBinaryHexDescription
10000001103Table identifier for Color Table
20000000101Modifier flags: use_color_type enabled
30000000101Configuration flags: use_constant_alpha enabled
411111111FFconstant_alpha = 255, fully opaque
50000000000Table links: none set
60000001002Record count = 2 colors
70000000000Color 0: color_type = 0 (Dynamic)
80000000000Color 0: red = 0
90000000000Color 0: green = 0
100000000000Color 0: blue = 0
110000000101Color 1: color_type = 1 (Absolute)
1211111111FFColor 1: red = 255
1311111111FFColor 1: green = 255
1411111111FFColor 1: blue = 255

Clone this wiki locally