Skip to main content
added 136 characters in body
Source Link
Zelda
  • 41k
  • 10
  • 114
  • 183

The W3C has explicit guidelines for web content accessability, including contrast. You can compare color values to their ratio and tell the user if their color choices are likely inaccessible/unreadable.

The visual presentation of text and images of text has a contrast ratio of at least 4.5:1

Note there are exceptions and some good guidance in the full set of guidelines. If you're doing something so simple as checking whether white or black is most readable, comparing the contrast ratio is the easiest way. Note that this may not always result in ideal colors if black and white are the only text options. Readability is more complex than just contrast, which is why the W3C guidelines go into things like font size and other considerations.

Here's a great tool to let you to test contrast in text. You can get a good idea of what is checked for in color accessibility and consider giving your users a display somewhat like that; present the text on their chosen background, and consider giving them a warning message if their text is considerably below the readability threshold.

The W3C has explicit guidelines for web content accessability, including contrast. You can compare color values to their ratio and tell the user if their color choices are likely inaccessible/unreadable.

The visual presentation of text and images of text has a contrast ratio of at least 4.5:1

Note there are exceptions and some good guidance in the full set of guidelines. If you're doing something so simple as checking whether white or black is most readable, comparing the contrast ratio is the easiest way. Note that this may not always result in ideal colors if black and white are the only text options.

Here's a great tool to let you to test contrast in text. You can get a good idea of what is checked for in color accessibility and consider giving your users a display somewhat like that; present the text on their chosen background, and consider giving them a warning message if their text is considerably below the readability threshold.

The W3C has explicit guidelines for web content accessability, including contrast. You can compare color values to their ratio and tell the user if their color choices are likely inaccessible/unreadable.

The visual presentation of text and images of text has a contrast ratio of at least 4.5:1

Note there are exceptions and some good guidance in the full set of guidelines. If you're doing something so simple as checking whether white or black is most readable, comparing the contrast ratio is the easiest way. Note that this may not always result in ideal colors if black and white are the only text options. Readability is more complex than just contrast, which is why the W3C guidelines go into things like font size and other considerations.

Here's a great tool to let you to test contrast in text. You can get a good idea of what is checked for in color accessibility and consider giving your users a display somewhat like that; present the text on their chosen background, and consider giving them a warning message if their text is considerably below the readability threshold.

Source Link
Zelda
  • 41k
  • 10
  • 114
  • 183

The W3C has explicit guidelines for web content accessability, including contrast. You can compare color values to their ratio and tell the user if their color choices are likely inaccessible/unreadable.

The visual presentation of text and images of text has a contrast ratio of at least 4.5:1

Note there are exceptions and some good guidance in the full set of guidelines. If you're doing something so simple as checking whether white or black is most readable, comparing the contrast ratio is the easiest way. Note that this may not always result in ideal colors if black and white are the only text options.

Here's a great tool to let you to test contrast in text. You can get a good idea of what is checked for in color accessibility and consider giving your users a display somewhat like that; present the text on their chosen background, and consider giving them a warning message if their text is considerably below the readability threshold.