[go: up one dir, main page]

Skip to content

Color: change color contrast method to use APCA

Follow-up to fix(utils): Change color util to use relative l... (gitlab-ui!3418 - merged)

Discussion output:

We discussed the different approaches and landed with: whichever algorithm is fine, however given that these changes require updating here, and in gitlab (color_utils.js and color.rb) it would be simpler to implement WCAG 2.1 as we can potentially use existing an ruby gem.

Alternatively, we could write a simplified abstraction of WCAG or APCA as a standalone package (or if small enough included in utils directly). This should make it easier to maintain.

The current approach of calling a contrast comparison function in colorFromBackground makes sense as we can update, refactor, or swap out the comparison algorithm without needing to update usage 👍

see gitlab-ui!3418 (comment 1368000974)

Related to gitlab-ui!3418 (merged) & !118622 (merged)