Function: choosePalette()
ts
function choosePalette(config, paletteOverride?): TerrainLevel[];Selects or builds the terrain palette for a given planet config.
Routes through strategyFor — each body type provides its own palette generator + densification rule. All non-rocky generators feed their base palette through a shared remapping helper so getTileLevel(elevation, palette) with integer elevation ∈ [0, N-1] resolves to palette[elevation] regardless of the body type.
Parameters
| Parameter | Type | Description |
|---|---|---|
config | BodyConfig | Body configuration (drives the strategy lookup). |
paletteOverride? | TerrainLevel[] | When provided, short-circuits the generators and returns this array verbatim. Caller is responsible for sizing/thresholding it consistently with resolveTerrainLevelCount(radius, coreRadiusRatio). |