diff --git a/tooling/planet-gen/biomes.toml b/tooling/planet-gen/biomes.toml index 910f744d8..b63b4c0ac 100644 --- a/tooling/planet-gen/biomes.toml +++ b/tooling/planet-gen/biomes.toml @@ -265,13 +265,17 @@ M = [1.00, 0.88, 0.78] # ───────────────────────────────────────────────────────────────────── [atmosphere_colors] -temperate = [0.45, 0.65, 1.00] -oceanic = [0.40, 0.60, 1.00] -forest = [0.42, 0.68, 0.80] -arid = [0.90, 0.72, 0.50] -martian = [0.82, 0.58, 0.40] -frozen = [0.75, 0.88, 1.00] -volcanic = [0.55, 0.40, 0.30] +temperate = [0.45, 0.65, 1.00] +temperate_terminator = [0.48, 0.62, 0.95] +oceanic = [0.40, 0.60, 1.00] +forest = [0.42, 0.68, 0.80] +arid = [0.90, 0.72, 0.50] +cold_arid = [0.82, 0.58, 0.40] +hot_arid = [0.92, 0.68, 0.42] +tropical = [0.48, 0.72, 0.85] +boreal = [0.50, 0.68, 0.95] +frozen = [0.75, 0.88, 1.00] +volcanic = [0.55, 0.40, 0.30] # ───────────────────────────────────────────────────────────────────── # Gas giant band palettes (globe renderer) diff --git a/tooling/planet-gen/render_heightmap.py b/tooling/planet-gen/render_heightmap.py index 0e71eb7b1..642b67a83 100644 --- a/tooling/planet-gen/render_heightmap.py +++ b/tooling/planet-gen/render_heightmap.py @@ -282,7 +282,7 @@ def _render_title(img: Image.Image, body_def: dict) -> Image.Image: name = body_def.get("name") or body_def.get("id", "Unknown") bid = body_def.get("id", "") - pclass = body_def.get("planet_class", "").replace("_ringed", "") + pclass = body_def.get("planet_class", "").replace("_", " ") star = body_def.get("star", {}) orbit = body_def.get("orbit", {}) phys = body_def.get("physical", {}) @@ -370,10 +370,19 @@ def _render_legend(img: Image.Image, terrain: dict) -> Image.Image: max_step = (OUT_W - 2 * pad_x) // max(max_items, 1) step = min(int(108 * UI_SCALE), max_step) + # Max label width = step minus swatch minus gaps + max_label_px = step - sw - gap - int(4 * UI_SCALE) + lx = pad_x for label, rgb in items: draw.rectangle([(lx, leg_y), (lx + sw, leg_y + sh)], fill=rgb) - draw.text((lx + sw + gap, leg_y), label, + # Truncate label to fit allocated space + display = label + while display and draw.textlength(display, font=font) > max_label_px: + display = display[:-1] + if display != label and display: + display = display[:-1] + "…" + draw.text((lx + sw + gap, leg_y), display, fill=(185, 192, 205), font=font) lx += step diff --git a/tooling/planet-gen/scaffold_bodies.py b/tooling/planet-gen/scaffold_bodies.py index 479ebc279..7de8f2e4f 100644 --- a/tooling/planet-gen/scaffold_bodies.py +++ b/tooling/planet-gen/scaffold_bodies.py @@ -104,7 +104,7 @@ def _body_prose(bd: dict, system_dir: Path) -> str: lines.append("| | |") lines.append("|---|---|") lines.append(f"| **Type** | {btype} |") - lines.append(f"| **Class** | {pclass} |") + lines.append(f"| **Class** | {pclass.replace('_', ' ')} |") if phys.get("gravity_g") and not is_gas: lines.append(f"| **Gravity** | {phys['gravity_g']}g |") if phys.get("atmosphere") and phys["atmosphere"] != "none":