Schemas / Pixel / raster

rig.pixel.palette

v0.31.0 · draft 1 field 1 required

Fields

FieldTypeMeaning
colors array<rgba>min 1 items required Ordered entries; index i selects colors[i] (floats 0-1)

Ordered indexed colour table. Format when present.

Compose rig.meta.named for a label. Canvas clear and paint rgba stay as floats 0-1; this schema documents the discrete palette a host uses when interpreting indexed pixels (rig.pixel.tile_set).

Hosts that ship a fixed console palette still serialize it here when a document needs portable colour identity. Runtime remaps (pal() swaps) stay in the host.

An index at or past colors.length (e.g. in rig.pixel.tile_set indices) is a document error. A writer must not emit one; a lenient reader renders it as the last entry rather than crashing, but must not silently rewrite the data.

JSON Schema

Resolves at https://rig.works/schemas/rig.pixel.palette.schema.jsonraw file.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://rig.works/schemas/rig.pixel.palette.schema.json",
  "title": "rig.pixel.palette",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "colors": {
      "type": "array",
      "items": {
        "$ref": "./_defs.schema.json#/$defs/rgba"
      },
      "minItems": 1
    }
  },
  "required": [
    "colors"
  ]
}