fix(assets): address PR #119 review round 2 — biomes.toml, legend, profile table
1. Add 5 extended atmosphere colors to biomes.toml (globe renderer reads
from toml, not body_def) — cold_arid, hot_arid, tropical, boreal,
temperate_terminator. Remove dead martian entry. Slightly differentiate
colors from base classes.
2. Fix profile table raw identifiers — apply .replace('_', ' ') to class
field in wiki body pages.
3. Fix legend text overflow — truncate labels with ellipsis when step
size is too narrow for full text.
4. Fix title panel underscores — use .replace('_', ' ') instead of
.replace('_ringed', '').
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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":
|
||||
|
||||
Reference in New Issue
Block a user