paint-brush
How To Generate WCAG Compliant Contrast Color in Bootstrapby@itzsrikanth
972 reads
972 reads

How To Generate WCAG Compliant Contrast Color in Bootstrap

by Srikanth Sharma3mJanuary 15th, 2021
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

The intent of this Success Criterion is to provide enough contrast between text and its background so that it can be read by people with moderately low vision. Contrast ratio can be calculated by finding out relative luminance of both background and foreground colors in current loop. All these values are looped to find the suitable match. To achieve WCAG 2 AA contrast ratio, use color-contrast function to generate contrast text color. The color is returned to a color that matches the contrast ratio of foreground and background colors.

Company Mentioned

Mention Thumbnail
featured image - How To Generate WCAG Compliant Contrast Color in Bootstrap
Srikanth Sharma HackerNoon profile picture
Srikanth Sharma

Srikanth Sharma

@itzsrikanth

Passionate DivOps Engineer

Learn More
LEARN MORE ABOUT @ITZSRIKANTH'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Srikanth Sharma HackerNoon profile picture
Srikanth Sharma@itzsrikanth
Passionate DivOps Engineer

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite