@fantasy-color/luminance-for-contrast-ratio
v2.1.0
Published
For a given contrast ratio and a relative luminance, give a relative luminance that will match this contrast ratio
Downloads
17
Keywords
Readme
@fantasy-color/luminance-for-contrast-ratio
Calculate the contrast ratio between two relative luminances
type luminanceForContrastRatio = (contrastRatio: number, luminance: number) => number
Example usage:
import luminanceForContrastRatio from '@fantasy-color/luminance-for-contrast-ratio'
luminanceForContrastRatio(3, 0.8)
// > 0.2333333333333334