Skip to content

Enhance ThinkPy Output Accessibility for Color-Blind Users #13

@lwgray

Description

@lwgray

Labels: accessibility, enhancement, user-experience, high-priority

Current Situation

Our current color scheme may present challenges for users with color vision deficiencies:

  • Relies heavily on color alone to convey meaning
  • Uses red/green combinations which are problematic for many color-blind users
  • Lacks alternative visual indicators for distinguishing statement types
  • No way to customize or override color choices

Impact

According to color blindness statistics:

  • Affects approximately 8% of males and 0.5% of females
  • Red-green color blindness is most common
  • Blue-yellow color blindness affects about 0.01% of population
  • Complete color blindness (monochromacy) is rare but exists

Primary Proposed Solution: Shape + Color System

Approach

Implement a combined shape-and-color system where each statement type has:

  1. A distinctive prefix symbol
  2. Color-blind friendly colors
  3. Optional bold/italic formatting
# Example output format:
■ [PROGRAM] Main execution started          # Square prefix + Blue
▶ [TASK] Processing data                   # Triangle prefix + Cyan
● [STEP] Loading file                      # Circle prefix + Yellow
⬥ [VARIABLE] count = 5                     # Diamond prefix + White
▢ [SUBTASK] Calculate average              # Hollow square + Light blue
⬡ [LOOP] Starting iteration                # Hollow hexagon + Purple

Color Palette

Use a carefully selected colorblind-friendly palette:

COLORBLIND_SAFE_COLORS = {
    'PROGRAM':   '\033[38;5;75m',   # Blue
    'TASK':      '\033[38;5;80m',   # Light cyan
    'STEP':      '\033[38;5;220m',  # Yellow
    'VARIABLE':  '\033[38;5;255m',  # White
    'SUBTASK':   '\033[38;5;117m',  # Light blue
    'LOOP':      '\033[38;5;147m',  # Light purple
    'DECISION':  '\033[38;5;180m',  # Light brown
    'OUTPUT':    '\033[38;5;145m',  # Light gray
}

SYMBOLS = {
    'PROGRAM':   '■',  # Filled square
    'TASK':      '▶',  # Triangle
    'STEP':      '●',  # Circle
    'VARIABLE':  '⬥',  # Diamond
    'SUBTASK':   '▢',  # Hollow square
    'LOOP':      '⬡',  # Hollow hexagon
    'DECISION':  '◆',  # Filled diamond
    'OUTPUT':    '▹',  # Small triangle
}

Implementation Details

  1. Add new configuration option: --accessibility-mode
  2. Create AccessibilityFormatter class to handle different formatting needs
  3. Allow customization of symbols through config file
  4. Add high contrast mode option

Why This Approach Works

  1. Multiple Distinguishing Features:

    • Shape provides primary identification
    • Color provides secondary reinforcement
    • Position remains consistent
    • Optional text styling adds third identifier
  2. Testing Methodology:

    • Can be validated with color blindness simulators
    • Works even in grayscale
    • Symbols remain clear at different terminal sizes
  3. Flexibility:

    • Users can customize symbols
    • Colors can be adjusted
    • Works with screen readers (symbols have text equivalents)

Alternative Approaches

1. Indentation-Based System

PROGRAM: Main execution
    TASK: Processing data
        STEP: Loading file
            VARIABLE: count = 5
        SUBTASK: Calculate average
            LOOP: Starting iteration

Pros:

  • No reliance on color or symbols
  • Clear hierarchy
  • Works in plain text

Cons:

  • Takes more vertical space
  • Harder to scan quickly
  • Less visually appealing

2. Pattern-Based System

### PROGRAM ### Main execution started
=== TASK === Processing data
--- STEP --- Loading file
*** VARIABLE *** count = 5
+++ SUBTASK +++ Calculate average
~~~ LOOP ~~~ Starting iteration

Pros:

  • Distinctive without color
  • Works in any terminal
  • Easy to implement

Cons:

  • More visual noise
  • Takes horizontal space
  • Less professional looking

3. Number-Based System

[1] PROGRAM: Main execution started
[1.1] TASK: Processing data
[1.1.1] STEP: Loading file
[1.1.1.1] VARIABLE: count = 5
[1.1.2] SUBTASK: Calculate average
[1.1.2.1] LOOP: Starting iteration

Pros:

  • Clear hierarchy
  • Works without color
  • Good for documentation

Cons:

  • Complex for deeply nested structures
  • Numbers can be distracting
  • Takes extra space

Next Steps

  1. Create prototype with shape+color system
  2. Test with color blindness simulators
  3. Get feedback from users with color vision deficiencies
  4. Implement configuration system
  5. Add documentation and examples
  6. Create automated tests for accessibility

Technical Requirements

  • Unicode support for symbols
  • Terminal compatibility testing
  • Screen reader testing
  • Configuration file format
  • Color contrast validation

Questions

  1. Should we provide multiple accessibility modes for different needs?
  2. How can we make the configuration system user-friendly?
  3. Should we add sound cues for certain events?
  4. How can we maintain backward compatibility?

Resources

Please share thoughts on the proposed approaches and any additional considerations for accessibility.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions