Skip to content

ANSI colour contrast (more generally) #3596

Description

@penelopeysm

In #3595 I specifically changed the colours for :white and :light_white so that they weren't exactly the same as the background. I didn't want to make that PR expand in scope without asking first, but I do think the screenshots there (reattached here for convenience) show that there are still some colours that have quite low contrast:

Image Image

Blue on dark mode for example is pretty hard to see.

Some of these will always have low contrast by virtue of being e.g. (light) black or (light) white on a black or white background, but there are 14/16 colours which we could try to optimise a bit better in order to improve accessibility.

In particular, since Pluto is a web app, I think the WCAG guidelines are a good benchmark: https://developer.mozilla.org/en-US/docs/Web/Accessibility/Guides/Understanding_WCAG/Perceivable/Color_contrast It'll be quite difficult to get to 4.5:1 for every single colour, but we could try to shift the needle a bit. If you think this is worth doing, I can try to look for some colour palettes that have better contrast properties.

For reference, this is the current situation (Claude helped me with this a bit):

┌────────────────┬─────────┬────────────┬────────────┐
│     Color      │   Hex   │ vs #FFFFFF │ vs #1F1F1F │
├────────────────┼─────────┼────────────┼────────────┤
│ black          │ #000000 │ 21.0 pass  │ 1.27 FAIL  │
├────────────────┼─────────┼────────────┼────────────┤
│ red            │ #BB0000 │ 6.74 pass  │ 2.44 FAIL  │
├────────────────┼─────────┼────────────┼────────────┤
│ green          │ #00BB00 │ 2.58 FAIL  │ 6.36 pass  │
├────────────────┼─────────┼────────────┼────────────┤
│ yellow         │ #BBBB00 │ 2.05 FAIL  │ 8.02 pass  │
├────────────────┼─────────┼────────────┼────────────┤
│ blue           │ #0000BB │ 12.2 pass  │ 1.34 FAIL  │
├────────────────┼─────────┼────────────┼────────────┤
│ magenta        │ #BB00BB │ 5.48 pass  │ 3.00 FAIL  │
├────────────────┼─────────┼────────────┼────────────┤
│ cyan           │ #00BBBB │ 2.37 FAIL  │ 6.92 pass  │
├────────────────┼─────────┼────────────┼────────────┤
│ white          │ #BEBEBE │ 1.85 FAIL  │ 8.86 pass  │
├────────────────┼─────────┼────────────┼────────────┤
│ bright-black   │ #555555 │ 7.45 pass  │ 2.21 FAIL  │
├────────────────┼─────────┼────────────┼────────────┤
│ bright-red     │ #FF5555 │ 3.14 FAIL  │ 5.24 pass  │
├────────────────┼─────────┼────────────┼────────────┤
│ bright-green   │ #00FF00 │ 1.37 FAIL  │ 12.0 pass  │
├────────────────┼─────────┼────────────┼────────────┤
│ bright-yellow  │ #FFFF55 │ 1.06 FAIL  │ 15.4 pass  │
├────────────────┼─────────┼────────────┼────────────┤
│ bright-blue    │ #5555FF │ 5.08 pass  │ 3.24 FAIL  │
├────────────────┼─────────┼────────────┼────────────┤
│ bright-magenta │ #FF55FF │ 2.62 FAIL  │ 6.27 pass  │
├────────────────┼─────────┼────────────┼────────────┤
│ bright-cyan    │ #55FFFF │ 1.22 FAIL  │ 13.4 pass  │
├────────────────┼─────────┼────────────┼────────────┤
│ bright-white   │ #F0F0F0 │ 1.13 FAIL  │ 14.4 pass  │
└────────────────┴─────────┴────────────┴────────────┘

Activity

  1. marked Terminal ANSI colors contrast #3623 as a duplicate of this issue on Oct 8, 2026
  2. added
    frontendConcerning the HTML editor
    accessibilityAccessibility improvements of the frontend, like screen reader support and internationalization
    on Oct 8, 2026
  3. abhijeetnardele24-hash commented on Oct 8, 2026

    @abhijeetnardele24-hash

    Hey @fonsp, fair point! I used an AI assistant to help draft the PR description so it looked professional, but I see how it came off as totally robotic. My bad!

    To answer your question: the core issue is that standard ANSI output assumes a dark terminal. If we blindly invert all colors for light mode, we ruin semantic meanings (like green for success or red for error).

    My approach in the PR was to only invert the grayscale colors (white text becomes dark gray) and slightly darken the bright colors so they pass contrast ratios against a light background. This matches how VS Code handles their Light+ theme, keeping the original color intent intact.

    I'd love to keep working on this! Should I migrate my CSS changes to a new PR linked to this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    accessibilityAccessibility improvements of the frontend, like screen reader support and internationalizationfrontendConcerning the HTML editorgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions