Gets the contrast between the passed in colors.
Swapping color a and b in the parameter list doesn't change the resulting value. The maximum value is 21 (or the contrast between black and white).
a
b
First color to query. The default is white.
white
The color to compare against. The default is black.
black
import { contrast } from '@skchr/color'console.log(contrast("blue", "red"));// 21 Copy
import { contrast } from '@skchr/color'console.log(contrast("blue", "red"));// 21
Gets the contrast between the passed in colors.
Swapping color
aandbin the parameter list doesn't change the resulting value. The maximum value is 21 (or the contrast between black and white).