EmilHvitfeldt / prismatic

color manipulation R package Simply and Tidy

Home Page:https://emilhvitfeldt.github.io/prismatic/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Provide contrast ratio function

hadley opened this issue · comments

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.

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

Closed as duplicate of #18

I can't believe I already filed this issue and you fixed it 😆