31 packages found
Relative luminance formula
APCA: the Accessible Perceptual Contrast Algorithm, a modern contrast method that improves readability contrast on self-illuminated displays. Developed for the W3C's WCAG 3 and other standards.
bare-bones color luminance functions
Detects if a hex color is dark or light. It is based on the w3 documentation for color luminance: https://www.w3.org/TR/WCAG20/#relativeluminancedef
See Stars • a lightweight set of utilities to take an sRGB or displayP3 color, and extract the CIE Y relative luminance, and then convert to CIE L* (perceptual lightness). Takes RGB colors as simple arrays (as created with colorParsley). Bonus utilities t
Delta Phi Star is a general purpose method of determining perceptual lightness contrast developed by Andrew Somers (Myndex Research), and is a sibling of APCA and SACAM. It is a simplified method using easily invertible standardized maths, however it lack
Utility functions for working with colors in adherence to WCAG 2.1 guidelines.
- wcag
- wcag-2.1
- accessibility
- accessible
- color
- colors
- contrast
- contrast-ratio
- luminance
- luminosity
- suggestion
- generator
Get relative luminance from a color string.
Evaluate if a to colors have sufficient contrast to pass WCAG requirements.
- wcag
- color
- contrast
- luminance
- contrast-ratio
- accessibility
- a11y
- relative-luminance
- color-contrast
- text-legibility
Change the hue of a color without changing the relative luminance
Calculate the color in an array of colors that gives the highest contrast to another color.
Colour transformation utilities
Calculate contrast ratio between two CSS color strings.
Color converter for JavaScript/TypeScript
Lightweight (no dependencies) and fast color brightness detector built with Flow Types.
Convert RGB to grayscale
Tools for collections of colors
For a given color, find a contrasting color (not optimal).
Reads luminance and histogram data from JPEG images (based on Bill Yeh's pixelr)