Provide contrast ratio function
hadley opened this issue · comments
Hadley Wickham commented
like colorspace::contrast_ratio("#dc3545", "#f8f9fa")
Not exactly related to the core purpose of the package, but when generating colours it is very useful to be able to check their accessibility.
Emil Hvitfeldt commented
Are you thinking contrast_ratio()? 😁
https://emilhvitfeldt.github.io/prismatic/reference/contrast_ratio.html
Also have best_contrast() helper which is vectorized by first argument
https://emilhvitfeldt.github.io/prismatic/reference/best_contrast.html
Emil Hvitfeldt commented
Closed as duplicate of #18
Hadley Wickham commented
I can't believe I already filed this issue and you fixed it 😆