|
group2 0.1.0
CSE 125 Group 2
|
VOIDFALL HUD design tokens — colors, sizes, and shared helpers. More...
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{k_tertiary.r, k_tertiary.g, k_tertiary.b, 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{k_tertiary.r, k_tertiary.g, k_tertiary.b, 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{k_quaternary.r, k_quaternary.g, k_quaternary.b, 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_primary {0.168627f, 0.694118f, 0.741176f, 1.0f} |
| Deep panel background — opaque so HUD chrome doesn't pick up sky tint. | |
| constexpr HudColor | voidfall::k_secondary {0.250980f, 0.478431f, 0.501961f, 1.0f} |
| constexpr HudColor | voidfall::k_tertiary {0.615686f, 0.858824f, 0.882353f, 1.0f} |
| constexpr HudColor | voidfall::k_quaternary {0.070588f, 0.270588f, 0.290196f, 1.0f} |
| constexpr HudColor | voidfall::k_bgVoid {k_quaternary.r, k_quaternary.g, k_quaternary.b, 0.96f} |
| constexpr HudColor | voidfall::k_bgPanel {k_quaternary.r, k_quaternary.g, k_quaternary.b, 0.92f} |
| Standard panel fill — bumped to 0.92α (was 0.78). | |
| constexpr HudColor | voidfall::k_bgPanelSolid {k_quaternary.r, k_quaternary.g, k_quaternary.b, 0.96f} |
| Solid panel — used for hero callouts. | |
| constexpr HudColor | voidfall::k_bgInset {k_quaternary.r, k_quaternary.g, k_quaternary.b, 0.92f} |
| Inset bar background. | |
| constexpr HudColor | voidfall::k_lineDim {k_secondary.r, k_secondary.g, k_secondary.b, 0.7f} |
| Dim hairline — oklch(0.32 0.015 60 / 0.6). | |
| constexpr HudColor | voidfall::k_line {k_secondary.r, k_secondary.g, k_secondary.b, 0.95f} |
| Standard hairline — oklch(0.40 0.018 60). | |
| constexpr HudColor | voidfall::k_lineBright {k_tertiary.r, k_tertiary.g, k_tertiary.b, 1.0f} |
| Bright hairline — oklch(0.55 0.02 60). | |
| constexpr HudColor | voidfall::k_textDim {k_secondary.r, k_secondary.g, k_secondary.b, 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 {k_tertiary.r, k_tertiary.g, k_tertiary.b, 1.0f} |
| Standard text — bumped slightly toward white for body chrome. | |
| constexpr HudColor | voidfall::k_textBright {k_tertiary.r, k_tertiary.g, k_tertiary.b, 1.0f} |
| Brightest text — kept near-white for hero readouts. | |
| constexpr HudColor | voidfall::k_amber {k_primary.r, k_primary.g, k_primary.b, 1.0f} |
| Primary amber — oklch(0.80 0.165 75). | |
| constexpr HudColor | voidfall::k_amberDim {k_secondary.r, k_secondary.g, k_secondary.b, 1.0f} |
| Dimmer amber — oklch(0.65 0.13 75). | |
| constexpr HudColor | voidfall::k_amberDeep {k_quaternary.r, k_quaternary.g, k_quaternary.b, 1.0f} |
| Deep amber — oklch(0.45 0.10 70). | |
| constexpr HudColor | voidfall::k_amberGlow {k_primary.r, k_primary.g, k_primary.b, 0.18f} |
| Amber glow tint — oklch(0.80 0.165 75 / 0.15). | |
| constexpr HudColor | voidfall::k_red {k_primary.r, k_primary.g, k_primary.b, 1.0f} |
| Health red — oklch(0.65 0.20 28). | |
| constexpr HudColor | voidfall::k_redBright {k_tertiary.r, k_tertiary.g, k_tertiary.b, 1.0f} |
| Bright tail of HP gradient — oklch(0.72 0.18 35). | |
| constexpr HudColor | voidfall::k_redDim {k_secondary.r, k_secondary.g, k_secondary.b, 1.0f} |
| Dim red — oklch(0.50 0.15 28). | |
| constexpr HudColor | voidfall::k_health {0.92f, 0.96f, 0.97f, 1.0f} |
| constexpr HudColor | voidfall::k_healthBright {1.0f, 1.0f, 1.0f, 1.0f} |
| constexpr HudColor | voidfall::k_cyan {k_tertiary.r, k_tertiary.g, k_tertiary.b, 1.0f} |
| Shield cyan — oklch(0.80 0.10 220). | |
| constexpr HudColor | voidfall::k_cyanDim {k_secondary.r, k_secondary.g, k_secondary.b, 1.0f} |
| Dim cyan — oklch(0.55 0.08 220). | |
| constexpr HudColor | voidfall::k_green {k_tertiary.r, k_tertiary.g, k_tertiary.b, 1.0f} |
| Status green — oklch(0.78 0.16 145). | |
| constexpr HudColor | voidfall::k_pickupBg {k_quaternary.r, k_quaternary.g, k_quaternary.b, 0.82f} |
| Pickup amber-trim background. | |
| constexpr HudColor | voidfall::k_typeAr = k_primary |
| constexpr HudColor | voidfall::k_typeSniper = k_tertiary |
| constexpr HudColor | voidfall::k_typePistol = k_secondary |
| constexpr HudColor | voidfall::k_typeSmg = k_primary |
| constexpr HudColor | voidfall::k_typeShotgun = k_secondary |
VOIDFALL HUD design tokens — colors, sizes, and shared helpers.
Mirrors the design system from the VOIDFALL HUD prototype:
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.