render

package
v0.5.3 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 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 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