Added color-blind safe patterns to RiskGauge sector arcs to distinguish risk levels beyond color alone, complying with WCAG 1.4.1 (Use of Color).
Added three new pattern classes for risk level sectors:
.risk-gauge-pattern--high: Diagonal stripes (stroke-dasharray: 4, 3).risk-gauge-pattern--medium: Dots pattern (stroke-dasharray: 1, 6 with round caps).risk-gauge-pattern--low: Crosshatch-like alternating dashes (stroke-dasharray: 8, 4)
Each pattern uses CSS stroke-dasharray to create distinct visual textures that work alongside the existing color coding (success/warning/error).
Added @media (forced-colors: active) override to ensure patterns work in high-contrast mode by falling back to solid CanvasText strokes.
- Imported
../styles/patterns.cssto load the pattern definitions - Updated sector arc path element to include both
risk-gauge-sector-arcand the appropriate pattern class (risk-gauge-pattern--${sector.id}) - No API changes - this is a visual enhancement only
Added focused test: "each sector arc has a color-blind safe pattern class"
- Verifies that high, medium, and low sector arcs receive their respective pattern classes
- Ensures the pattern classes are correctly applied based on sector ID
- High risk zone (70-100): Green with diagonal stripe pattern
- Medium risk zone (50-69): Amber with dot pattern
- Low risk zone (0-49): Red with alternating dash pattern
These patterns provide additional visual distinction for users with color vision deficiencies while maintaining the existing color semantics for sighted users.
- Improves WCAG 1.4.1 compliance by providing non-color differentiation
- Patterns are subtle and don't interfere with the existing color coding
- High-contrast mode override ensures compatibility with Windows high-contrast themes
- No changes to screen reader behavior or keyboard navigation
- Added unit test to verify pattern classes are applied correctly
- Test verifies each sector (high, medium, low) receives its corresponding pattern class
- Existing accessibility tests continue to pass
- Uses standard CSS stroke-dasharray property with wide browser support
- Patterns degrade gracefully in browsers that don't support dasharray (falls back to solid color)
- High-contrast mode override ensures visibility in forced-colors environments
- Patterns are applied via CSS classes only - no JavaScript logic changes
- The implementation follows the existing pattern established in
patterns.cssfor other components (e.g., RepaymentVisualizer) - Design tokens and dark-mode consistency are maintained through the use of existing color variables