Get the color contrast of two colors
color_contrast_checker(foreground, background = "#FFFFFF")
foreground | Character string. An R color or color as hex. |
---|---|
background | Character string. An R color or color as hex. Default is white/'#FFFFFF'. |
If you have jsonlite, it will return a data frame of the ratio and which standards are passed. Otherwise you get the same information but as a character vector.
This uses the api at webaim.org to determine the contrast ratio of the foreground color to the background color. This is useful to ensure chosen colors meet web standards for accessibility.