render

package
v0.5.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package render holds the visual constant tables shared across screens — body color palette, UI tier colors for status / nodes / trajectory.

v0.5.1 source of truth per docs/state-of-game.md §3 v0.5: a hardcoded table here, keyed by body name (or stellar tint by temperature for non-Sol stars). The v0.7 config-file body loader will promote the table to per-body JSON fields with a one-shot migration; in the meantime this single file is the only place to edit when adding a new body or retuning a color.

Index

Constants

This section is empty.

Variables

View Source
var (
	ColorAlert       = lipgloss.Color("#FF5F5F") // hard errors, peri-below-surface
	ColorWarning     = lipgloss.Color("#FFAF00") // warp clamps, near-collision
	ColorPlannedNode = lipgloss.Color("#5FD7FF") // maneuver-node markers
	ColorTrajectory  = lipgloss.Color("#FFFFFF") // home-SOI trajectory preview
	ColorForeignSOI  = lipgloss.Color("#D75FFF") // post-SOI-crossing trajectory segments
	ColorDim         = lipgloss.Color("#5F5F5F") // background / inactive
)

UI tier colors — used for non-body UI elements that need consistent semantic colors across screens. Independent of the body palette so editing one doesn't shift the other.

Functions

func BodyRings added in v0.5.11

func BodyRings(bodyID string) (innerR, outerR float64, ok bool)

BodyRings returns the inner and outer ring radii (meters from body center) for ringed bodies, or ok=false if the body has no renderable rings. Numbers are face-on simplifications — our equatorial-plane projection always shows rings as concentric circles, not the inclination-dependent ellipses real Saturn rings project to.

func ColorFor

func ColorFor(b bodies.CelestialBody) lipgloss.Color

ColorFor returns the palette color for a body. Falls back to a per-bodyType default for bodies not in the table (e.g. fictional systems' planets), and finally to ColorTrajectory for unrecognised types. Star colors come from StellarTint when temperature is set.

func GlyphFor added in v0.5.12

func GlyphFor(b bodies.CelestialBody) rune

GlyphFor returns the body-identity Unicode glyph for the given body. Used as a single-cell overlay on top of the body's drawille disk so different body types read distinctly even at small pixel- radius. v0.5.12+.

  • Star → ☉ (sun symbol)
  • Gas giant (radius > 20 000 km) → ◉ (fisheye)
  • Terrestrial planet → ● (filled circle)
  • Moon → ○ (open circle)

Returns 0 (zero rune) when no overlay is appropriate (e.g. system primary already has a ring+dot draw style and shouldn't be double-glyphed).

func StellarTint

func StellarTint(tempK float64) lipgloss.Color

StellarTint maps a star's effective temperature (Kelvin) to a rough visible-light color. Used for non-Sol stars that don't have a hand-picked entry in bodyPalette. Banding is coarse — five buckets covering M-dwarf through O-class.

func Style

Style returns a lipgloss.Style with the body's color as the foreground. Convenience wrapper for HUD / body-info text — call Style(b).Render("Earth") to print a colored label.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL