Skip to content

Conversation

@rich-iannone
Copy link
Member

@rich-iannone rich-iannone commented Sep 20, 2022

This updates the ideal_fgnd_color() util function add the APCA contrast also. This determines Lc contrast between overlaid text on a background color. The background is fixed and the text color is swapped to the alternative (light or dark) that maximizes contrast. The code here is adapted from the SAPC APCA (Accessible Perceptual Contrast Algorithm). The WCAG algo has been added here as a (non-default) alternative in data_color(). Here is a comparison table demonstrating the differences between the WCAG and APCA contrast schemes.

contrast-compare

@rich-iannone rich-iannone marked this pull request as ready for review September 20, 2022 14:20
@rich-iannone rich-iannone marked this pull request as draft September 20, 2022 14:48
@rich-iannone rich-iannone marked this pull request as ready for review September 21, 2022 00:57
Copy link
Member

@cscheid cscheid left a comment

Choose a reason for hiding this comment

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

Looks good!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants