class

ContributorMural::Renderers::Skyline

Inherits ContributorMural::Renderer < Reference < Object

A city skyline: each contributor is a building on a shared street, its height set by their weight — the people carrying the project are the towers — with the avatar up top like a rooftop billboard and a hash-lit grid of windows below it. Buildings wrap into further rows past the configured width, each row bottom-aligned on its own ground strip.

Constants

ANTENNA_H = 12.0
ANTENNA_W = 2.0
CLIP_ID = "skyline-clip"
DARK_INKS = {building: "#21262d", lit: "#f2cc60", unlit: "#30363d", ground: "#30363d"}
FLOOR_CAP = 32

Most rows of windows one wall will draw. Well clear of what the default band asks for (a 220px tower glazes 12), so it only ever bites the towers that would otherwise be drawn in specks.

GROUND_H = 2.0
JITTER_SHARE = 0.35

Height jitter as a share of the smallest step between weight ranks — under half, so jitter can never reorder what the weights decided.

LABEL_H = 16.0
LIGHT_INKS = {building: "#d0d7de", lit: "#fff8c5", unlit: "#afb8c1", ground: "#afb8c1"}

A clean daytime silhouette on light walls, a dusk city on dark ones. Hardcoded per mode like orbit's ring: the four-colour palette record has no slot for architecture, and a per-style palette is not worth its keys.

LIT_RATIO = 0.5

Share of windows lit.

PAD = 6.0

Side padding between a building's wall and its avatar; a building is avatar_size + 2 * PAD wide.

ROOF_BAND = 8.0

The roof zone every silhouette variation stays inside, so the avatar always sits against the full-width body underneath it.

ROOF_TYPES = 6

How many roof silhouettes draw_roof knows.

ROW_GAP = 24.0
SALT_HEIGHT = 1_u64
TOP_PAD = 4.0

Headroom over each row's tallest extent.

Instance methods

fetch_size(user : ResolvedUser) : Int32

Pixel size at which to fetch this user's avatar (2x render size for crisp display on high-DPI screens).

Source
prepare(users : Array(ResolvedUser)) : Nil

Heights rank the distinct weights across the whole document — a thousandfold outlier lands at the top of the band exactly like a twofold one, and a section of equals renders low rather than faking a skyline of towers. Keyed by login, so sectioning cannot move anyone.

Source