kirby-colors
kirby-colors copied to clipboard
[Feature Request] Helper Functions to Directly Check Accessibility Contrast
It would be super useful to have some helper functions that directly check whether two colours pass certain specified accessibility rating - i.e., 'aa', 'aaa', 'aaLarge' and 'aaaLarge'.
Right now, to do that we have to define the colours in question in a blueprint, then use the toReadabilityReport()
method to generate an array, then search the array for the results. I'd love to be able to do the checks by simply getting a boolean from something like isAA($colour1, $colour2)
, or isAAALarge($colour1, $colour2)
.