Kredal Docs
Adr

ADR 0005 — Risk-colour tokens bound to score bands

Why risk colours are a fixed, single-source token system.

  • Status: Accepted
  • Date: 2026-07-13

Context

The product communicates risk visually (gauge, category bars, badges). If risk colours were chosen ad-hoc per component, the UI could drift from the engine — e.g. a "green" badge on a high-risk score — undermining trust.

Decision

Define three risk-semantic colour tokens (low/medium/high) that mean risk only, mapped directly to the score bands. A single utility riskLevel(score) in src/lib/scoring/risk.ts is the sole place the band → risk mapping exists; every component consumes it. Colour is always paired with an icon and text label (accessibility).

Consequences

  • Positive: the UI can never disagree with the engine; colour-blind-safe by construction; consistent light/dark theming.
  • Negative: contributors must resist using risk colours decoratively. Enforced by the design-tokens reference and design-system rules.

On this page