kirby-colors icon indicating copy to clipboard operation
kirby-colors copied to clipboard

[Feature Request] Helper Functions to Directly Check Accessibility Contrast

Open iocouto opened this issue 2 years ago • 0 comments

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).

iocouto avatar Nov 16 '21 21:11 iocouto