Skip to content

readTintOpacity

readTintOpacity(metadata): object

Defined in: packages/declarative-hex-worlds/src/asset-source/tileset.ts:144

The per-placement tint + opacity read off flat placement metadata, so a game can drive fog-of-war / season / team shading over a shared atlas from the sim. Metadata is flat (Record<string, string|number|boolean|null>), so the tint is carried as three sibling keys:

  • tintR / tintG / tintB (channels [0, 1]) → tint — ONLY when ALL three are present AND finite numbers (a partial/typo’d tint is ignored, never a half-applied colour);
  • opacity (a number) → opacity — ONLY when it’s a finite number in [0, 1]. Anything else is omitted, leaving the request on its default opaque/untinted path.

Readonly<Record<string, string | number | boolean | null>>

object

optional opacity?: number

optional tint?: AssetTint