DEV Community

Cover image for WCAG AA Contrast in a Finance App: Why Accessibility Is a Legal and Moral Must
DEVANSHU PATIL
DEVANSHU PATIL

Posted on

WCAG AA Contrast in a Finance App: Why Accessibility Is a Legal and Moral Must

WCAG AA Contrast in a Finance App: Why Accessibility Is a Legal and Moral Must

In personal finance applications, color is not just decoration. Color is information.

  • Green tells you money was earned.
  • Red warns you money was spent or an account was overdrawn.
  • Amber signals that a budget is close to its limit or a transaction is pending confirmation.
  • Blue indicates an internal transfer where money simply moved between accounts.

When a user opens their financial ledger, their eyes scan colors before they read a single digit.

However, in many mobile apps, color choices are driven purely by aesthetics. A designer picks a trendy pastel green or neon red in Figma. It looks gorgeous in a mock-up, but in real life:

  • In bright outdoor sunlight, a light green on a white background is completely invisible.
  • In dark mode, a deep crimson red on a dark surface becomes an illegible smudge.
  • For users with low vision or color blindness, financial status cues vanish entirely.

During Hardening Sprint H7 (docs/HARDENING_SPRINTS.md:H7, commit f4a56cc), we audited and overhauled FinLedger's design system to achieve strict WCAG AA Contrast Compliance (4.5:1 ratio) across both Light and Dark themes.

Here is how we engineered accessible financial color tokens in Jetpack Compose.

The Pitfall of Symmetric Colors in Light and Dark Modes

A common mistake in mobile design is using symmetric color hex codes across both themes:

flowchart TD
    subgraph ContrastFailures["The Symmetric Color Trap"]
        Design["Designer Picks Single Emerald Green: #10B981"]

        Design --> LightTheme["Light Theme (White Background #FFFFFF):
        Contrast Ratio: 2.8:1
        FAIL WCAG AA (< 4.5:1)
        Invisible in direct sunlight!"]

        Design --> DarkTheme["Dark Theme (Surface #121212):
        Contrast Ratio: 8.5:1
        PASS WCAG AA"]
    end

A color that passes contrast standards on a dark background will almost always fail on a pure white background.

Conversely, a dark red (#B91C1C) that provides a crisp 6.1:1 contrast on white collapses to a muddy 1.9:1 ratio on a dark OLED surface.

To build an accessible financial application, semantic colors must be calibrated independently for each theme.

The Calibrated Semantic Token System (FinLedgerColors.kt)

In Sprint H7, we replaced hard-coded colors with a semantic token architecture where every financial state possesses a theme-specific hex code verified against WCAG AA requirements:

flowchart TD
    subgraph SemanticSystem["FinLedger Semantic Color Architecture"]
        direction TB

        subgraph IncomeTokens["Income / Asset Tokens"]
            IncLight["Light Mode: Deep Emerald (#047857)
            Contrast: 5.8:1 on #FFFFFF (PASS)"]
            IncDark["Dark Mode: Mint Emerald (#34D399)
            Contrast: 8.2:1 on #121212 (PASS)"]
        end

        subgraph ExpenseTokens["Expense / Liability Tokens"]
            ExpLight["Light Mode: Deep Crimson (#B91C1C)
            Contrast: 6.1:1 on #FFFFFF (PASS)"]
            ExpDark["Dark Mode: Coral Rose (#F87171)
            Contrast: 7.4:1 on #121212 (PASS)"]
        end

        subgraph WarningTokens["Budget Warning Tokens"]
            WarnLight["Light Mode: Amber Ochre (#B45309)
            Contrast: 4.8:1 on #FFFFFF (PASS)"]
            WarnDark["Dark Mode: Radiant Amber (#FBBF24)
            Contrast: 9.1:1 on #121212 (PASS)"]
        end
    end

By calibrating lightness and saturation values for each surface:

  • In Light Theme, colors use darker shades (values around 600–700 in standard color scales) to provide high contrast against crisp white and light-gray cards.
  • In Dark Theme, colors use brighter, pastel-tinted tones (values around 300–400) to stand out sharply against deep charcoal (#121212) and OLED black surfaces without causing eye strain.

The Cardinal Rule: Never Rely on Color Alone

WCAG guideline 1.4.1 establishes an essential accessibility principle: Color must not be the sole visual means of conveying information.

Roughly 8% of men and 0.5% of women experience some form of color vision deficiency (such as Deuteranomaly or Protanopia, where red and green appear nearly identical). If an app only uses red and green to distinguish expenses from income, a significant portion of users cannot tell whether they gained or lost money!

In FinLedger, every financial metric combines color with three secondary visual indicators:

  1. Explicit Arithmetic Symbols: Every transaction amount is prefixed with an unambiguous mathematical sign (+Rs. 5,000.00 for income, -Rs. 1,450.00 for expenses).
  2. Directional Arrow Icons: Income items display an upward diagonal arrow (ArrowUpRight), while expenses display a downward diagonal arrow (ArrowDownLeft).
  3. Semantic Text Badges: In statement tables and review sheets, transactions include explicit textual tags: "Expense", "Income", or "Internal Transfer".
flowchart LR
    A["Color Cue:
    Emerald Green"] + B["Symbol Cue:
    +Rs. 1,200.00"] + C["Icon Cue:
    Arrow Up-Right"] + D["Label Cue:
    'Income'"] --> Complete["100% Accessible to All Users"]

Even if a user views the app in grayscale mode on an e-ink display or suffers from total color blindness, the financial meaning of every number is crystal clear.

Key Takeaway

Accessibility in fintech is not an optional afterthought; it is an obligation to your users.

Financial decisions depend on clarity. By establishing theme-calibrated semantic tokens that exceed WCAG AA contrast ratios and pairing color cues with explicit symbols and directional icons, FinLedger guarantees that your financial numbers remain readable anywhere, on any device, under any lighting condition.


FinLedger is a privacy-first, offline-first personal finance application for Android that models bank accounts, credit cards, and cash without double-counting.

Explore FinLedger on Google Play: https://play.google.com/store/apps/details?id=com.devanshufinance.app

Top comments (0)