Files
tidewall/src/client/style/palette.gd
T
claudeandClaude Opus 5.5 a4e81479bb A6: Sea, sky and weather
Weather.at(tide, tick) derives the weather from the tide's schedule
alone, so every client sees the same sky with nothing new on the wire:
the storm builds from calm at the first tide to a gale at sudden death,
and the light runs from mid-afternoon to dusk at the time limit.
WeatherView applies it each sync to the sky, sun, fog, ambient light,
the sea's roughness and rain around the camera (CPUParticles3D, for
both renderers). Under water the view closes into SEA_MURK, the rain
stops and the surface is a rippled ceiling seen from below.

The sea shader darkens open water and adds chop and whitecaps with the
storm, and keeps a breathing foam band at the waterline with a fainter
line beyond. In the Compatibility renderer, whose depth texture the
shader can't read (the sea came out all foam), water depth comes from
a texture of the terrain's heights instead. Sea colours move into
Palette; the rain and wind beds follow the weather.

Tests: test_weather (7). make check passes (611 tests). Captures:
make sea-captures (every tide phase, calm beach, the last land in the
gale, under water, and three in the Compatibility renderer).

Closes #46

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 18:05:42 -05:00

115 lines
5.5 KiB
GDScript

## Tidewall's one table of colours: the drowned-coast palette from docs/STYLE.md.
## Every colour the client draws with comes from here, so the look stays one look; a
## test (test_palette.gd) fails on a colour literal anywhere else in src/client,
## src/app or src/ui. All values are sRGB. Add a colour here, named for what it is in the world,
## before using it, and add it to the table in docs/STYLE.md.
class_name Palette
extends RefCounted
# --- Wood, rope and tar -------------------------------------------------------------
## Fresh pine tar on hulls, piles and sheds. The darkest thing in the world.
const TAR: Color = Color(0.19, 0.16, 0.13)
## Tar that has weathered grey-brown: wrecks and old piles.
const TAR_WEATHERED: Color = Color(0.31, 0.26, 0.22)
## Grey planking on walls and decks.
const PLANK: Color = Color(0.50, 0.45, 0.37)
## Planks bleached pale by salt and sun: wreck ribs, jetties.
const PLANK_BLEACHED: Color = Color(0.64, 0.60, 0.52)
## Driftwood, the first build material.
const DRIFTWOOD: Color = Color(0.62, 0.50, 0.36)
## Crates and chests' unpainted wood.
const CRATE_WOOD: Color = Color(0.68, 0.55, 0.38)
## Pine bark.
const BARK: Color = Color(0.40, 0.30, 0.22)
## The dark inside of an emptied chest or hold.
const HOLD_SHADOW: Color = Color(0.22, 0.20, 0.18)
## Hemp rope and sailcloth, unbleached.
const CANVAS: Color = Color(0.84, 0.80, 0.68)
## Sails tanned with bark, as working boats had them.
const TANNED_SAIL: Color = Color(0.62, 0.44, 0.28)
# --- Stone, iron and salt -----------------------------------------------------------
## Field stone in walls and quays.
const STONE: Color = Color(0.56, 0.54, 0.49)
## Loose boulders, a touch cooler than walls.
const BOULDER: Color = Color(0.56, 0.55, 0.51)
## Dressed stone, the second build material.
const DRESSED_STONE: Color = Color(0.60, 0.59, 0.55)
## Yellow-grey lichen on high rock.
const LICHEN: Color = Color(0.62, 0.61, 0.45)
## Rusted salvage iron, the third build material.
const SALVAGE_IRON: Color = Color(0.50, 0.34, 0.26)
## Salt pans and whitewash.
const SALT: Color = Color(0.90, 0.90, 0.86)
# --- Salt-faded paint ---------------------------------------------------------------
## Red ochre roofs and doors, faded.
const OCHRE_RED: Color = Color(0.56, 0.27, 0.20)
## Verdigris sea-green paint on trim, shutters and sea chests.
const SEA_PAINT: Color = Color(0.33, 0.55, 0.56)
## Oilskin yellow: the local player's coat, and the one warm accent of the HUD.
const OILSKIN: Color = Color(0.86, 0.66, 0.16)
## Moss-green oilskin.
const OILSKIN_MOSS: Color = Color(0.36, 0.40, 0.30)
## Slate-grey oilskin.
const OILSKIN_SLATE: Color = Color(0.48, 0.46, 0.44)
## Faded navy oilskin.
const OILSKIN_NAVY: Color = Color(0.30, 0.36, 0.48)
## Gilt on carved figureheads, loot glints and the lamp's brass.
const GILT: Color = Color(0.93, 0.80, 0.42)
## Lamp glass, lit.
const LAMP: Color = Color(0.98, 0.86, 0.55)
## Weathered skin.
const SKIN: Color = Color(0.74, 0.58, 0.46)
# --- Growing things -----------------------------------------------------------------
const NEEDLES: Array[Color] = [Color(0.22, 0.36, 0.28), Color(0.26, 0.40, 0.30), Color(0.31, 0.44, 0.32)]
const SCRUB: Array[Color] = [Color(0.45, 0.48, 0.30), Color(0.53, 0.53, 0.34)]
# --- Sky and air --------------------------------------------------------------------
const SKY_TOP: Color = Color(0.32, 0.50, 0.68)
## The pale, salt-hazed horizon.
const SKY_HAZE: Color = Color(0.82, 0.78, 0.68)
const SKY_BELOW: Color = Color(0.18, 0.20, 0.20)
const SEA_FOG: Color = Color(0.78, 0.78, 0.74)
## Weather (A6): the gale's low cloud overhead and on the horizon, the dusk haze and the
## low sun's warm light, as the match wears on and the storm builds.
const STORM_SKY: Color = Color(0.36, 0.40, 0.44)
const STORM_HAZE: Color = Color(0.58, 0.60, 0.60)
const DUSK_HAZE: Color = Color(0.86, 0.66, 0.50)
const DUSK_SUN: Color = Color(1.0, 0.78, 0.56)
## Rain streaks, pale and mostly clear.
const RAIN: Color = Color(0.80, 0.84, 0.86, 0.22)
# --- The sea (A6) -------------------------------------------------------------------
## Water over sand, open water, the gale's darker open water and the foam.
const SEA_SHALLOW: Color = Color(0.42, 0.55, 0.50)
const SEA_DEEP: Color = Color(0.10, 0.22, 0.30)
const SEA_STORM: Color = Color(0.13, 0.20, 0.22)
const SEA_FOAM: Color = Color(0.86, 0.88, 0.84)
## Under the surface: the murk a swimmer sees.
const SEA_MURK: Color = Color(0.12, 0.28, 0.30)
# --- Print and paper (the woodcut pass and the HUD) ---------------------------------
## Printer's ink: outlines and hatching, warm, never pure black.
const INK: Color = Color(0.16, 0.13, 0.11)
## Unbleached paper: HUD panels and text on dark ground.
const PAPER: Color = Color(0.91, 0.87, 0.78)
## Paper in shadow, for panel edges and dimmed text.
const PAPER_DIM: Color = Color(0.66, 0.62, 0.54)
## Brass seen on paper: the edge of the menu control that has focus.
const GILT_DEEP: Color = Color(0.62, 0.45, 0.12)
## Dark text outline on the HUD.
const OUTLINE: Color = Color(0.08, 0.08, 0.08)
# --- Signals ------------------------------------------------------------------------
## "Allowed" in the build ghost: sea green.
const GHOST_OK: Color = Color(0.46, 0.80, 0.70, 0.38)
## "Refused" in the build ghost: rust red.
const GHOST_REFUSED: Color = Color(0.86, 0.32, 0.22, 0.38)
## Danger on the HUD: the tide's next line, low health. Paired with a shape or a word,
## never alone.
const WARNING: Color = Color(0.86, 0.32, 0.22)
## The sea on the HUD's tide gauge and map.
const SEA_INK: Color = Color(0.20, 0.34, 0.42)