@fantasy-color/luminance-for-contrast-ratio

@fantasy-color/luminance-for-contrast-ratio

npm i @fantasy-color/luminance-for-contrast-ratio

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

Jump To