FreeTubeApp / FreeTube

An Open Source YouTube app for privacy
https://freetubeapp.io/
GNU Affero General Public License v3.0
13.69k stars 867 forks source link

[Feature Request]: Mark & sort color themes by color contrast with base theme #3934

Open kommunarr opened 1 year ago

kommunarr commented 1 year ago

Guidelines

Problem Description

Currently, many main & secondary color themes have insufficient color contrast with some base themes. This is an accessibility issue that can extremely worsen the user experience for colorblind users and even non-colorblind users alike.

Screenshot_20230823_084733

Caption: The screenshot above shows the settings page of FreeTube with a base theme of Light and primary & secondary theme colors of Catppuccin Mocha Pink. The color contrast between the Catppuccin Mocha Pink - colored label text and the white card background is 1.52:1, far below the 7:1 required for small text as per the Level AAA success criterion of the WCAG 2.

Sources: https://webaim.org/articles/contrast/ https://uxdesign.cc/colour-contrast-in-ux-design-477011020095

Proposed Solution

On loading the Settings section, sort the theme colors by their contrast with the main theme and visually mark which ones have insufficient color contrast, OR vice versa (e.g., place a checkmark by ones with sufficient color contrast and have a label explaining what that means). This allows users to more easily identify which color themes would be a good choice for the given base theme.

Option A (Preferred):

  • On changing the theme, override all inaccessible* primary and secondary theme colors with a default value and display them with a strikethrough (e.g., Catppuccin Mocha Pink) and lower opacity in the corresponding ft-select box(es) on the Theme Settings tab.
    • Add a message above each ft-select box wherein the current value is being overridden with a default that this is what is occurring and why.
    • Retain the user's actual primary & secondary selections (& "re-enable" them) if a new theme is switched to at any point in time. In other words, don't implement this such that the user's selections are overwritten with the default values, but just overwrite their styling internally.
    • (Strongly recommended) Sort the ft-select primary and secondary theme color boxes such that inaccessible struck-through colors are all at the bottom or top of the list (bottom seems preferable by my estimation).

Option B:

*Inaccessible in the context means "color contrast between that theme's card-bg-color and the foreground color fails the Level AA criterion of the WCAG 2 (i.e., 4.5:1 minimum color contrast ratio)." Note that this can and should be detected programmatically based off of the two colors' lumninances! You can use this library and access the card-bg-colors in one of the manners outlined here.

Alternatives Considered

Issue Labels

visual improvement

Additional Information

The About Page has different background colors for text, but it is the only major exception.

efb4f5ff-1298-471a-8973-3d47447115dc commented 1 month ago