Description Usage Arguments Value Examples
Computes the WCAG contrast ratio between two colors. A minimum contrast of 4.5:1 is recommended to ensure that text is still readable against a background color.
1 | chroma_contrast(color1, color2)
|
color1 |
Hexadecimal string or a name for color. |
color2 |
Hexadecimal string or a name for color. |
a numeric value
1 2 3 4 5 6 7 8 | chroma_contrast("pink", "hotpink")
# black on light grey => good
chroma_contrast("#e3e3e3", "black")
# black on dark grey => bad
chroma_contrast("#393939", "black")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.