johannesjo / angular-material-css-vars

Little library to use css variables with @angular/material
https://johannesjo.github.io/angular-material-css-vars/
MIT License
194 stars 32 forks source link

fix: choose auto contrast color based on calculated contrast #144

Closed json-derulo closed 1 year ago

json-derulo commented 1 year ago

Description

Updates the auto contrast functionality by calculating the actual contrast agains black and white, and choosing the color with the better contrast.

Issues Resolved

Partly fixes #143

Check List

json-derulo commented 1 year ago

This is not a breaking change, however in existing application this may switch the text colors from white to black and vice versa in quite some cases. For this reason this will only be included in the next major version. With Angular 17 around the corner this shouldn't take too long anyways.