This is a package for color utils
npm install @bluemojo/utils
Utils for different transformation between color schemas (hsl, hsb/hsl, rgb).
hslToRgb(color: IHsl): IRgb
hslToHsb(color: IHsl): IHsb
hsbToRgb(color: IHsb): IRgb
hsbToHsl(color: IHsb): IHsl
rgbToHsl(color: IRgb): IHsl
Utils for checking contrast between colors. Implemented according to WCAG guidelines.
rgbContrast(color1: IRgb, color2: IRgb): number
wcagAASmallText(contrast: number): boolean
wcagAALargeText(contrast: number): boolean
wcagAANonText(contrast: number): boolean
wcagAAASmallText(contrast: number): boolean
wcagAAALargeText(contrast: number): boolean