🌈 Generate the nearest accessible color
Generate the nearest accessible color.
$ npm install a11ycolor
const a11yColor = require('a11ycolor');
a11yColor(red, blue); // This returns #FFA3A3
The function a11yColor
function takes three parameters:
a11yColor($toMakeA11y, $background, ($ratioKey = 'small'));
toMakeA11y
- The color that is to be made accessible on the backgroundbackground
- The background color to for the contrastratioKey
- The keyword 'small' ( 4.5 ) or 'large' ( 3.0 ) for the WCAG 2.1 contrast ratioeslint
with xo
, adjust formatting.npmignore
prepublishOnly
script