You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Web Content Accessibility Guidelines (WCAG) define best practices for colors used on websites. These guidelines could easily be used to define a WCAG extension on UIColor.
How does it work in detail?
I'm not too sure about all requirements, yet, so I'm looking for some suggestions. Here is what I came up with initially.
Expose functions to get:
The contrast ratio for a pair of colors
A high contrast foreground color for a given background color (white, black, or the first match from a given list of colors)
A high contrast background color for a given background color (white, black, or the first match from a given list of colors)
A high contrast foreground color for a given background image (white, black, or the first match from a given list of colors)
The contrast requirements are based on the text size, background alpha, level of conformance, and font weight.
We need to create a UIColor extension meeting the requirements above. The function names and params are up to the author. We also need to create a separate subspec and extend the existing example projects with a new screen to showcase this feature.
What kind of feature would you like to see?
The Web Content Accessibility Guidelines (WCAG) define best practices for colors used on websites. These guidelines could easily be used to define a WCAG extension on
UIColor
.How does it work in detail?
I'm not too sure about all requirements, yet, so I'm looking for some suggestions. Here is what I came up with initially.
Expose functions to get:
The contrast requirements are based on the text size, background alpha, level of conformance, and font weight.
See https://webaim.org/articles/contrast/
What does the API look like?
We need to create a
UIColor
extension meeting the requirements above. The function names and params are up to the author. We also need to create a separate subspec and extend the existing example projects with a new screen to showcase this feature.Any existing projects that do something similar?
I've seen one project that exposes an API to calculate the contrast ratio for a given color pair: https://github.com/soffes/Color
The text was updated successfully, but these errors were encountered: