Color Accessibility Guide
Approved semantic color pairings and contrast rules for GlycemicGPT web UI.
Color Accessibility Guide
This guide defines approved color pairings for the current web UI foundation.
Baseline Rules
- The default light and dark themes should pass WCAG AA. See WCAG 2.2 conformance.
- Normal text needs at least
4.5:1contrast. See WCAG 1.4.3 Contrast Minimum. - Large text needs at least
3:1contrast. See WCAG 1.4.3 Contrast Minimum. - Important icons, borders, selected states, and controls need at least
3:1contrast against adjacent colors. See WCAG 1.4.11 Non Text Contrast. - Focus indicators must be visible and should keep at least
3:1contrast against adjacent colors. See WCAG 2.4.7 Focus Visible and WCAG 2.4.13 Focus Appearance. - High contrast mode is an enhancement. It is not a reason to ship known contrast failures in the default theme. See WCAG conforming alternate versions.
- Do not rely on color alone for state, status, or medical meaning. See WCAG 1.4.1 Use of Color.
- Use semantic utilities first. Do not use raw Tailwind palette classes for shared UI.
- If a pairing is not listed here, calculate contrast before using it.
Current Tokens
Light surfaces:
--color-surface-page: #ffffff
--color-surface-primary: #ffffff
--color-surface-secondary: #e6e8e6
--color-surface-tertiary: #ced0ce
--color-surface-elevated: #f7f9fb
--color-surface-fixed-dark: #000000
--color-surface-fixed-critical: #cd1d0c
Dark surfaces:
--color-surface-page: #20242a
--color-surface-primary: #20242a
--color-surface-secondary: #343a42
--color-surface-tertiary: #59636f
--color-surface-elevated: #292f36
--color-surface-fixed-dark: #000000
--color-surface-fixed-critical: #cd1d0c
Dark 1 surfaces:
--color-surface-page: #172126
--color-surface-primary: #172126
--color-surface-secondary: #263941
--color-surface-tertiary: #3a5861
--color-surface-elevated: #1f2d34
--color-surface-fixed-dark: #000000
--color-surface-fixed-critical: #cd1d0c
Dark 2 surfaces:
--color-surface-page: #3a414b
--color-surface-primary: #3a414b
--color-surface-secondary: #5f6266
--color-surface-tertiary: #949ea8
--color-surface-elevated: #464d57
--color-surface-fixed-dark: #000000
--color-surface-fixed-critical: #cd1d0c
Dark 3 surfaces:
Same as Dark surfaces.
Foreground:
--color-foreground-primary: #191919 in light, #f6f8fa in dark
--color-foreground-secondary: #767676 in light, #c4cbd3 in dark
--color-foreground-muted: #ced0ce in light, #707982 in dark
--color-foreground-fixed-light: #ffffff
Dark 1 foreground:
--color-foreground-primary: #f3fbfb
--color-foreground-secondary: #bad0d6
--color-foreground-muted: #617a83
Dark 2 foreground:
--color-foreground-primary: #ffffff
--color-foreground-secondary: #a7b0ba
--color-foreground-muted: #5f6266
Dark 3 foreground:
Same as Dark foreground.
Light accent:
--color-accent: #5eb1ff
--color-accent-hover: #4da8ff
--color-accent-foreground: #191919
Dark accent:
--color-accent: #118dff
--color-accent-hover: #36a4ff
--color-accent-foreground: #14212a
Dark 1 accent:
--color-accent: #7df2d8
--color-accent-hover: #9ff7e4
--color-accent-foreground: #102326
Dark 2 accent:
--color-accent: #5eb1ff
--color-accent-hover: #70bdff
--color-accent-foreground: #191919
Dark 3 accent:
--color-accent: #ff932e
--color-accent-hover: #fea42f
--color-accent-foreground: #14212a
Theme adaptive brand gradient:
--color-brand-gradient-start, --color-brand-gradient-middle, --color-brand-gradient-end
Light: #20c9ff, #5eb1ff, #064dff
Dark: #62b9ff, #118dff, #0457a5
Dark 1: #b4ffef, #7df2d8, #1aa88f
Dark 2: #20c9ff, #5eb1ff, #064dff
Dark 3: #fea42f, #ff932e, #fe5e2d
Theme adaptive brand highlight:
--color-brand-highlight
Light: #b7ddff
Dark: #62b9ff
Dark 1: #d9fff7
Dark 2: #d6f3ff
Dark 3: #ffe2b8
Overlay:
--color-overlay-primary: rgba(0, 0, 0, 0.50) in light and rgba(0, 0, 0, 0.30) in dark themes
--color-overlay-subtle: rgba(0, 0, 0, 0.25) in every theme
Signal:
--color-signal-partial-fill: #6f53ca in light, #bbaee6 in dark
--color-signal-partial-text: #6f53ca in light, #e5e0ff in dark
--color-signal-info-fill: #2b7272 in light, #65c5c5 in dark
--color-signal-info-text: #2b7272 in light, #a5f3f3 in dark
--color-signal-check-fill: #2a7643 in light, #34d399 in dark
--color-signal-check-text: #2a7643 in light, #34d399 in dark
--color-signal-warning-fill: #f8c129 in light, #f6a61d in dark
--color-signal-warning-text: #b24600 in light, #ffe08a in dark
--color-signal-error-fill: #cd1d0c in light, #ff8a80 in dark
--color-signal-error-text: #cd1d0c in light, #ff8a80 in dark
Dark 2 signal differences:
--color-signal-check-fill: #67c987
--color-signal-check-text: #a7f3c0
--color-signal-error-fill: #e94b3a
--color-signal-error-text: #ffd9d5
Dark 3 signals:
Same as Dark signals.
Glucose forecast chart data:
--color-data-glucose-forecast: #6f53ca in light, #bbaee6 in dark
Insulin chart data:
--color-data-insulin-basal: #2563eb in light, #60a5fa in dark
--color-data-insulin-bolus: #1d4ed8 in light, #93c5fd in dark
--color-data-insulin-correction: #b24600 in light, #f6a61d in dark
--color-data-insulin-automated: #1e3a8a in light, #bfdbfe in dark
--color-data-insulin-mode-sleep: #6f53ca in light, #bbaee6 in dark
--color-data-insulin-mode-exercise: #b24600 in light, #ffe08a in darkLight Theme Pairings
Approved for normal text:
bg-surface-pageorbg-surface-primarywithtext-foreground-primary:17.58:1.bg-surface-pageorbg-surface-primarywithtext-foreground-secondary:4.54:1.bg-surface-secondarywithtext-foreground-primary:14.27:1.bg-surface-tertiarywithtext-foreground-primary:11.33:1.bg-surface-elevatedwithtext-foreground-primary:16.66:1.bg-accentwithtext-accent-foreground:7.71:1.bg-accent-hoverwithtext-accent-foreground:7.00:1.bg-surface-fixed-darkwithtext-foreground-fixed-light:21:1.
Allowed only for large text or non text UI:
bg-surface-secondarywithtext-foreground-secondary:3.69:1.bg-surface-elevatedwithtext-foreground-secondary:4.30:1.
Not approved for readable text:
bg-surface-pageorbg-surface-primarywithtext-foreground-muted:1.55:1.bg-accentwith white text:2.28:1.
Dark Theme Pairings
Approved for normal text:
bg-surface-pageorbg-surface-primarywithtext-foreground-primary:14.64:1.bg-surface-pageorbg-surface-primarywithtext-foreground-secondary:9.52:1.bg-surface-secondarywithtext-foreground-primary:10.78:1.bg-surface-elevatedwithtext-foreground-primary:12.69:1.bg-accentwithtext-accent-foreground:4.90:1.bg-accent-hoverwithtext-accent-foreground:6.18:1.bg-surface-fixed-darkwithtext-foreground-fixed-light:21:1.
Not approved for readable text:
text-foreground-mutedremains for disabled, decorative, or non essential text only.bg-surface-tertiaryshould not host normal body text with the current semantic foreground tokens.- Do not put white text on
bg-accent.
Dark 1 Theme Pairings
Approved for normal text:
bg-surface-pageorbg-surface-primarywithtext-foreground-primary:15.60:1.bg-surface-pageorbg-surface-primarywithtext-foreground-secondary:10.20:1.bg-surface-secondarywithtext-foreground-primary:11.47:1.bg-surface-elevatedwithtext-foreground-primary:13.49:1.bg-accentwithtext-accent-foreground:12.06:1.bg-accent-hoverwithtext-accent-foreground:13.10:1.bg-surface-fixed-darkwithtext-foreground-fixed-light:21:1.
Not approved for readable text:
text-foreground-mutedremains for disabled, decorative, or non essential text only.bg-surface-tertiaryshould not host normal body text with the current semantic foreground tokens.- Do not put white text on
bg-accent.
Dark 2 Theme Pairings
Approved for normal text:
bg-surface-pageorbg-surface-primarywithtext-foreground-primary:10.31:1.bg-surface-pageorbg-surface-primarywithtext-foreground-secondary:4.69:1.bg-surface-pageorbg-surface-primarywithtext-accent:4.52:1.bg-surface-secondarywithtext-foreground-primary:6.13:1.bg-surface-elevatedwithtext-foreground-primary:8.54:1.bg-accentwithtext-accent-foreground:7.71:1.bg-accent-hoverwithtext-accent-foreground:8.72:1.bg-surface-fixed-darkwithtext-foreground-fixed-light:21:1.
Allowed only for large text or non text UI:
bg-surface-tertiarywithtext-foreground-inverse:3.79:1.bg-surface-elevatedwithtext-foreground-secondary:3.89:1.
Not approved for readable text:
bg-surface-pageorbg-surface-primarywithtext-foreground-muted:1.68:1.bg-surface-secondarywithtext-foreground-secondary:2.79:1.bg-accentwith white text:2.28:1.
Dark 3 Theme Pairings
Dark 3 uses the same neutral surfaces, foregrounds, borders, signals, overlays, and insulin data colors as Dark. Only its accent and brand gradient colors differ.
Approved for normal text:
bg-surface-pageorbg-surface-primarywithtext-foreground-primary:14.64:1.bg-surface-pageorbg-surface-primarywithtext-foreground-secondary:9.52:1.bg-surface-secondarywithtext-foreground-primary:10.78:1.bg-surface-elevatedwithtext-foreground-primary:12.69:1.bg-surface-pageorbg-surface-primarywithtext-accent:7.03:1.bg-surface-secondarywithtext-accent:5.17:1.bg-surface-elevatedwithtext-accent:6.09:1.bg-accentwithtext-accent-foreground:7.39:1.bg-accent-hoverwithtext-accent-foreground:8.25:1.bg-surface-fixed-darkwithtext-foreground-fixed-light:21:1.
Not approved for readable text:
text-foreground-mutedremains for disabled, decorative, or non essential text only.bg-surface-tertiarywithtext-accent:2.75:1.bg-accentwith white text:2.22:1.bg-accent-hoverwith white text:1.99:1.
Accent Rules
- Use
bg-accent text-accent-foregroundfor selected tabs, primary filled controls, checked controls, and highlight surfaces with text inside. - Do not put white text on
bg-accent. - Use white text on dark surfaces for primary copy.
- Use
text-foreground-secondaryfor secondary paragraphs and labels onbg-surface-pageorbg-surface-primary. - Do not use
text-accentfor paragraph copy. Use it for short emphasis only when the background isbg-surface-pageorbg-surface-primary.
Brand Color Rules
- Use the brand gradient tokens only for branded visual assets such as the Lumose logo.
- The middle stop matches the active accent in every theme. The start and end stops provide visible tonal separation.
- Use
brand-highlightfor bright, narrow animation highlights in branded visual assets. - Do not use the brand colors for text, controls, status, or medical meaning.
Surface Rules
bg-surface-pageandbg-surface-primarycan host normal text with primary and secondary foreground colors in every documented theme.bg-surface-secondarycan host normal text only withtext-foreground-primaryin every documented theme.bg-surface-elevatedcan host normal text only withtext-foreground-primaryin every documented theme.bg-surface-tertiaryshould not host normal body text in dark mode with the current semantic foreground tokens.text-foreground-mutedis for disabled, decorative, or non essential text only. Do not use it for labels, paragraphs, form hints, or critical metadata.bg-surface-fixed-criticalwithtext-foreground-fixed-lighthas5.56:1contrast and is approved for normal text in every documented theme.
Signal Color Rules
- Use
*-fillsignal tokens for backgrounds, badges, indicators, chart areas, and alert surfaces. - Use
*-textsignal tokens for signal-colored text and icons on neutral surfaces. - Use only the documented foreground color for text and icons placed directly on matching signal fill backgrounds.
- Do not use a fill token as body text unless its exact background pairing has been checked.
- Light theme signal text tokens pass normal text contrast on page, primary, and secondary surfaces. They pass non text contrast on tertiary.
- Dark theme signal text tokens pass normal text contrast on page, primary, and secondary surfaces. They are not approved on tertiary.
- Do not rely on color alone for medical or safety critical meaning. Pair signal color with text, icon shape, or label. See WCAG 1.4.1 Use of Color.
Insulin Chart Color Rules
- Use the
data-insulin-*tokens only for insulin data marks and their legends. - Pair each color with its documented marker shape and visible label. Color alone must not identify a dose type.
- Light theme tokens have at least
5.17:1contrast against the primary surface. The orange auto correction token has5.57:1contrast. - Dark theme tokens have at least
4.05:1contrast against the primary surface. The orange auto correction token has at least5.10:1contrast. - Sleep mode uses the documented partial signal palette values and Exercise mode uses the documented warning text palette values, each with normal text contrast against its matching primary surface.
- Text drawn inside an outlined insulin mark uses
foreground-primaryonsurface-primary. Sleep and Exercise intervals are paired with labeled legend entries so color is not the only distinction. - Manual boluses and auto corrections use the glucose marker rotated upward, with the marker tip aligned to the exact dose value. Manual boluses are blue and auto corrections are orange. Collision detection may move a marker horizontally while keeping its dose value alignment and connecting it to the exact event position. If every marker cannot fit without overlap, use the distinct bar colors instead. Dose hover details show the exact event timestamp.
Glucose Forecast Chart Color Rules
- Use
data-glucose-forecastonly for imported algorithm forecast curves and their legends. - Render the curve with a dashed stroke and a visible source label so color is not the only distinction.
- The light theme value has
5.58:1contrast against the primary surface. - The dark theme values have at least
5.06:1contrast against the primary surface.
Signal Contrast Reference
Light theme signal text on neutral surfaces:
signal-partial-text:5.58:1on page or primary,4.53:1on secondary,3.59:1on tertiary.signal-info-text:5.60:1on page or primary,4.54:1on secondary,3.61:1on tertiary.signal-check-text:5.57:1on page or primary,4.52:1on secondary,3.59:1on tertiary.signal-warning-text:5.57:1on page or primary,4.52:1on secondary,3.59:1on tertiary.signal-error-text:5.56:1on page or primary,4.51:1on secondary,3.58:1on tertiary.
Light theme signal fills with documented foreground:
signal-partial-fillwith white text:5.58:1.signal-info-fillwith white text:5.60:1.signal-check-fillwith white text:5.57:1.signal-warning-fillwith ink text:10.59:1.signal-error-fillwith white text:5.56:1.
Dark theme signal text on neutral surfaces:
signal-partial-text:12.20:1on page or primary,8.98:1on secondary,4.78:1on tertiary,10.58:1on elevated.signal-info-text:12.41:1on page or primary,9.13:1on secondary,4.86:1on tertiary,10.75:1on elevated.signal-check-text:8.11:1on page or primary,5.97:1on secondary,3.18:1on tertiary,7.03:1on elevated.signal-warning-text:12.09:1on page or primary,8.90:1on secondary,4.73:1on tertiary,10.48:1on elevated.signal-error-text:6.83:1on page or primary,5.03:1on secondary,2.67:1on tertiary,5.92:1on elevated.
Dark theme signal fills with documented foreground:
signal-partial-fillwith ink text:8.63:1.signal-info-fillwith ink text:8.66:1.signal-check-fillwith ink text:9.15:1.signal-warning-fillwith ink text:8.70:1.signal-error-fillwith ink text:7.70:1.
Dark 2 theme signal text on neutral surfaces:
signal-partial-text:8.07:1on page or primary,4.80:1on secondary,2.13:1on tertiary.signal-info-text:8.20:1on page or primary,4.88:1on secondary,2.17:1on tertiary.signal-check-text:7.96:1on page or primary,4.74:1on secondary,2.10:1on tertiary.signal-warning-text:7.99:1on page or primary,4.75:1on secondary,2.11:1on tertiary.signal-error-text:7.92:1on page or primary,4.71:1on secondary,2.09:1on tertiary.
Dark 2 theme signal fills with documented foreground:
signal-partial-fillwith ink text:8.63:1.signal-info-fillwith ink text:8.66:1.signal-check-fillwith ink text:8.61:1.signal-warning-fillwith ink text:8.70:1.signal-error-fillwith ink text:4.63:1.
Agent Workflow
- Start with the semantic pairing listed above.
- If the pair is not listed, calculate the contrast ratio before coding.
- If the pair fails, change the semantic mapping or add a narrowly justified semantic token.
- Do not solve a shared UI contrast problem with a local raw color class.
- Update this guide when shared token values or approved pairings change.