Urgent.News

What's breaking now, across thousands of outlets.

Tech

There are many themes, but this one is yours

At Earendil, our focus is creating products that respect users' choices. In refreshing the Pi terminal, we wanted a theme that adapts to the terminal it runs in, reflecting users' existing preferences. The result is the new system theme, now Pi's default, which adapts to the terminal's colors.

Contrast plays a crucial role in terminal themes. Picking colors is a matter of taste for the user, but ensuring sufficient contrast is essential for readability. However, measuring contrast is complex, as perceptions vary among individuals. To address this, we developed a survey to help users understand their color perception.

Each terminal theme consists of 16 ANSI colors, but the standard doesn't specify their appearance or relationship to the background. Bright colors emerged from terminals rendering bold text in brighter hues, which gave them a greater contrast. We analyzed over 460 themes in Ghostty, finding that bright colors maintain higher contrast in dark themes roughly 60% of the time, while in light themes, they only have about a quarter of that contrast.

The WCAG 2 contrast ratio measures contrast, ranging from 1:1 (no contrast) to 21:1 (black on white). Normal text should reach at least 4.5:1, while large text and UI elements require 3:1. Many themes prioritize aesthetics over accessibility, resulting in poor contrast. For instance, bright black often fails to meet the minimum contrast ratio of 3:1 in most dark themes, posing challenges for building accessible TUIs.

Our terminal theme defines 60 color roles, from body text and dim text to panels and error messages. We aimed to use users' colors while ensuring all roles remain readable. Contrast is primarily driven by lightness, with saturation playing a lesser role. To achieve this, we designed the system theme to determine color lightness based on contrast requirements, taking hues and chroma from the terminal's palette.

We outlined rules for each UI element, ensuring sufficient contrast with backgrounds and minimizing distraction. Calculating these contrasts involved a loop, starting with panels and determining lightness based on specific rules. Our prototype utilized reversed contrast algorithms to compute the theme, with implementations available on GitHub for WCAG and perceptual contrast.

Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at earendil.com →

More in Tech

40 Pakistanis Deported From Greece

Forty Pakistani nationals who had entered Greece illegally were deported and sent to Islamabad on a special flight. The deportees … Read More The post 40 Pakistanis Deported From Greece appeared first on ProPakistani .

More from Friday 9 October →