group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
VoidfallStyle.hpp File Reference

VOIDFALL HUD design tokens — colors, sizes, and shared helpers. More...

#include "HudContext.hpp"
#include "HudTypes.hpp"
Include dependency graph for VoidfallStyle.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  voidfall

Functions

constexpr HudColor voidfall::weaponTypeAccent (int weaponId)
 Map a weapon-type id (matching WeaponType integer order in ecs/components/WeaponState.hpp: 0=Rifle, 1=Rocket, 2=RailGun, 3=EnergyGun, 4-6=grenades) to its accent color.
constexpr HudColor voidfall::withAlpha (HudColor c, float alpha)
 Apply alpha to a palette color (for fade-out).
void voidfall::drawCornerBrackets (HudContext &ctx, float x, float y, float w, float h, float armLen=10.f, float thickness=1.f, float outset=0.f, HudColor color=k_amber)
 Draw four mil-spec L-shaped corner brackets around a rect.
void voidfall::drawPanel (HudContext &ctx, float x, float y, float w, float h, HudColor fill=k_bgPanel, HudColor border=k_line, float thickness=1.f)
 Draw a Voidfall panel: solid fill + 1 px outline.
void voidfall::drawTrailBar (HudContext &ctx, float x, float y, float w, float h, float fill01, float trail01, HudColor fillColor, HudColor trailColor=HudColor{0.95f, 0.95f, 0.95f, 0.45f}, HudColor bgColor=k_bgInset, HudColor borderColor=k_lineDim)
 Draw a horizontal stat bar with a damage-trail ghost (solid fill).
constexpr HudColor voidfall::lerpColor (HudColor a, HudColor b, float t)
 Lerp between two HudColors — used to compute the visible gradient endpoint when the bar is partially filled (so the fill always represents the same slice of the underlying full-bar gradient instead of stretching to the right end).
void voidfall::drawGradientTrailBar (HudContext &ctx, float x, float y, float w, float h, float fill01, float trail01, HudColor fillLeft, HudColor fillRight, HudColor trailColor=HudColor{0.95f, 0.95f, 0.95f, 0.45f}, HudColor bgColor=k_bgInset, HudColor borderColor=k_lineDim)
 Draw a horizontal stat bar whose live fill is a left→right gradient (e.g.
void voidfall::drawKeyTab (HudContext &ctx, const char *key, float x, float y, float fontSize, float padX=3.f, float padY=1.f, HudColor bgColor=HudColor{0.f, 0.f, 0.f, 0.45f}, HudColor borderColor=k_lineBright, HudColor textColor=k_textDim)
 Draw a bordered "key tab" pill with a single character inside.

Variables

constexpr HudColor voidfall::k_bgVoid {0.08f, 0.075f, 0.07f, 0.96f}
 Deep panel background — opaque so HUD chrome doesn't pick up sky tint.
constexpr HudColor voidfall::k_bgPanel {0.10f, 0.095f, 0.085f, 0.92f}
 Standard panel fill — bumped to 0.92α (was 0.78).
constexpr HudColor voidfall::k_bgPanelSolid {0.09f, 0.085f, 0.075f, 0.96f}
 Solid panel — used for hero callouts.
constexpr HudColor voidfall::k_bgInset {0.12f, 0.115f, 0.105f, 0.92f}
 Inset bar background.
constexpr HudColor voidfall::k_lineDim {0.32f, 0.30f, 0.28f, 0.7f}
 Dim hairline — oklch(0.32 0.015 60 / 0.6).
constexpr HudColor voidfall::k_line {0.42f, 0.40f, 0.37f, 0.95f}
 Standard hairline — oklch(0.40 0.018 60).
constexpr HudColor voidfall::k_lineBright {0.62f, 0.59f, 0.56f, 1.0f}
 Bright hairline — oklch(0.55 0.02 60).
constexpr HudColor voidfall::k_textDim {0.78f, 0.76f, 0.73f, 1.0f}
 Dim text — bumped luminance from ~0.55 to ~0.78 so secondary readouts (fire mode, "+reserve", "/mag", "[2] PULSAR") read clearly against the panel chrome instead of fading into it.
constexpr HudColor voidfall::k_text {0.92f, 0.90f, 0.87f, 1.0f}
 Standard text — bumped slightly toward white for body chrome.
constexpr HudColor voidfall::k_textBright {1.00f, 0.99f, 0.97f, 1.0f}
 Brightest text — kept near-white for hero readouts.
constexpr HudColor voidfall::k_amber {1.00f, 0.71f, 0.18f, 1.0f}
 Primary amber — oklch(0.80 0.165 75).
constexpr HudColor voidfall::k_amberDim {0.78f, 0.55f, 0.14f, 1.0f}
 Dimmer amber — oklch(0.65 0.13 75).
constexpr HudColor voidfall::k_amberDeep {0.50f, 0.35f, 0.10f, 1.0f}
 Deep amber — oklch(0.45 0.10 70).
constexpr HudColor voidfall::k_amberGlow {1.00f, 0.71f, 0.18f, 0.18f}
 Amber glow tint — oklch(0.80 0.165 75 / 0.15).
constexpr HudColor voidfall::k_red {0.92f, 0.30f, 0.20f, 1.0f}
 Health red — oklch(0.65 0.20 28).
constexpr HudColor voidfall::k_redBright {0.95f, 0.45f, 0.25f, 1.0f}
 Bright tail of HP gradient — oklch(0.72 0.18 35).
constexpr HudColor voidfall::k_redDim {0.65f, 0.20f, 0.15f, 1.0f}
 Dim red — oklch(0.50 0.15 28).
constexpr HudColor voidfall::k_cyan {0.45f, 0.78f, 0.96f, 1.0f}
 Shield cyan — oklch(0.80 0.10 220).
constexpr HudColor voidfall::k_cyanDim {0.20f, 0.50f, 0.70f, 1.0f}
 Dim cyan — oklch(0.55 0.08 220).
constexpr HudColor voidfall::k_green {0.30f, 0.86f, 0.45f, 1.0f}
 Status green — oklch(0.78 0.16 145).
constexpr HudColor voidfall::k_pickupBg {0.13f, 0.12f, 0.11f, 0.82f}
 Pickup amber-trim background.
constexpr HudColor voidfall::k_typeAr {0.20f, 0.65f, 0.70f, 1.0f}
constexpr HudColor voidfall::k_typeSniper {0.40f, 0.30f, 0.75f, 1.0f}
constexpr HudColor voidfall::k_typePistol {0.20f, 0.75f, 0.45f, 1.0f}
constexpr HudColor voidfall::k_typeSmg {0.95f, 0.65f, 0.18f, 1.0f}
constexpr HudColor voidfall::k_typeShotgun {0.85f, 0.30f, 0.20f, 1.0f}

Detailed Description

VOIDFALL HUD design tokens — colors, sizes, and shared helpers.

Mirrors the design system from the VOIDFALL HUD prototype:

  • Warm near-black base, amber primary, cyan shield, warm red HP/damage.
  • 1 px hairlines, mil-spec corner brackets on framed elements.
  • JetBrains-Mono-style telemetry feel (tabular numerals, all-caps labels).

Colors are converted from the prototype's oklch() tokens to linear sRGB-ish values that match perceptual intent within the existing HudColor (linear, straight-alpha) plumbing — they're rendered straight through HudContext into the existing tone-mapped HUD framebuffer, so the conversions are tuned by eye to feel right against the same backgrounds the prototype assumed.