SSAgov / ANDI

A tool to test web content for accessibility and 508 compliance.
https://www.ssa.gov/accessibility/andi/help/howtouse.html
Other
302 stars 76 forks source link

I think that the farthest parameter in the contrast function could remove the need to get contrastOnBlack and contrastOnWhite twice #147

Open ollie-iterators opened 2 years ago

ollie-iterators commented 2 years ago

I have noticed that contrastOnBlack and contrastOnWhite is gotten twice in cANDI, once in the contrast function and once in the getSuggestedColor function.

This is to figure out whether the color is closer to white or black. This is found in the contrast function, so that should not be needed to be done again in getSuggestedColor

ollie-iterators commented 2 years ago

I also was able to find a better way to get the background color of the element.

JohnCotterSSA commented 2 years ago

Makes sense. Can you share the better way to get the background color?