Skip to content

fix(theme): improve theme color contrast for macOS Terminal.app#21175

Merged
clocky merged 3 commits intomainfrom
fix/256-color-contrast
Mar 5, 2026
Merged

fix(theme): improve theme color contrast for macOS Terminal.app#21175
clocky merged 3 commits intomainfrom
fix/256-color-contrast

Conversation

@clocky
Copy link
Contributor

@clocky clocky commented Mar 4, 2026

Summary

Updates both light and dark theme colors to ensure a minimum 4.5:1 contrast ratio in xterm-256 environments, specifically targeting improved visibility and accessibility for macOS Terminal.app.

Details

  • Adjusted colors to meet 4.5:1 contrast standards against the default black background.
  • Adjusted colors to meet 4.5:1 contrast standards against the default white/light-gray background.
  • Scope: This PR only targets the default and definitions; no other themes (e.g., Ayu, GitHub, Solarized) are affected.
  • Replaces fix(theme): update default theme colors for improved contrast #21169 which was closed by automation.

Related Issues

Fixes #21170

@clocky clocky requested a review from a team as a code owner March 4, 2026 22:13
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the accessibility and readability of the CLI's default themes by adjusting color palettes to meet WCAG contrast ratio standards. The updates specifically benefit users of macOS Terminal.app, providing a more comfortable visual experience without impacting other theme configurations.

Highlights

  • Improved Color Contrast: Updated both light and dark theme colors to ensure a minimum 4.5:1 contrast ratio in xterm-256 environments.
  • Targeted Accessibility: Specifically improved visibility and accessibility for macOS Terminal.app users.
  • Scope Limitation: Changes are limited to the default lightTheme and darkTheme definitions; other themes are unaffected.
Changelog
  • packages/cli/src/ui/themes/theme.ts
    • Modified color definitions for the lightTheme to achieve a 4.5:1 contrast ratio against a light background.
    • Modified color definitions for the darkTheme to achieve a 4.5:1 contrast ratio against a dark background.
    • Replaced interpolateColor calls with direct hex color values for several theme properties in both light and dark themes.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-cli gemini-cli bot added area/core Issues related to User Interface, OS Support, Core Functionality 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. labels Mar 4, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the color palettes for the light and dark themes to improve contrast and accessibility, particularly for macOS Terminal.app. The changes involve replacing dynamically generated colors with hardcoded values that meet a 4.5:1 contrast ratio. While this is a positive step for accessibility, I've identified a few instances where different semantic color properties have been assigned the same hex value in both themes. This reduces visual distinction and should be addressed to improve UI clarity. My review includes specific comments on these duplicated color assignments.

@github-actions
Copy link

github-actions bot commented Mar 4, 2026

Size Change: -554 B (0%)

Total Size: 26 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 25.5 MB -554 B (0%)
./bundle/node_modules/@google/gemini-cli-devtools/dist/client/main.js 221 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.js 227 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/index.js 11.5 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/types.js 132 B 0 B
./bundle/sandbox-macos-permissive-open.sb 890 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B
./bundle/sandbox-macos-strict-open.sb 4.82 kB 0 B
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB 0 B

compressed-size-action

Copy link
Contributor

@jacob314 jacob314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@clocky
Copy link
Contributor Author

clocky commented Mar 4, 2026

The PR correctly addresses the contrast issues for xterm-256 terminals (like macOS Terminal.app) by adopting a high-contrast palette based on the xterm-256 standard.

I have updated the snapshots and fixed the two test failures in and that were caused by the color changes and the new default background.

Observations:

  • Visual Shift: This change significantly alters the default 'Default' and 'Default Light' themes for all users, moving from a soft palette to a very high-contrast ANSI-based one.
  • CI Fixes: CI was failing due to 41 mismatched snapshots and 2 logic-related test failures. These are now resolved in the latest commit.
  • Derived Colors: Derived semantic colors (like ) are now hardcoded hex values instead of using . This is a reasonable trade-off to ensure correct color mapping on 256-color terminals.

The code follows the repository's strict development rules and uses established React/Ink patterns.

@clocky clocky force-pushed the fix/256-color-contrast branch from ce1a3ef to 3474fa8 Compare March 5, 2026 23:15
@clocky clocky added this pull request to the merge queue Mar 5, 2026
Merged via the queue into main with commit 6aa6630 Mar 5, 2026
27 checks passed
@clocky clocky deleted the fix/256-color-contrast branch March 5, 2026 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Issues related to User Interface, OS Support, Core Functionality 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(theme): improve theme color contrast for macOS Terminal.app

2 participants