Sass-a11ycolor

functions

AU-a11ycolor

@function AU-a11ycolor($toMakeA11y, $background, $ratioKey: 'small') { ... }

Description

The function to find the nearest accessible color

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$toMakeA11y

The color that is to be changed

Color none
$background

The background color. Used to check the contrast ratio

Color none
$ratioKey

The keyword 'small' or 'large' to set the WCAG 2.1 contrast ratio to 3.0 (large) or 4.5 (small)

'small'</code> or <code>'large''small'

Example

color: AU-a11ycolor( red, blue );                  // returns: #ffa3a3
color: AU-a11ycolor( red, blue, large );           // returns: #ff6666
color: AU-a11ycolor( #c0c0c0, #c0c0c0, small, 1 ); // returns: #4d4d4d