SSAgov / ANDI

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

I believe there is an issue with farthest in cANDI #153

Open ollie-iterators opened 1 year ago

ollie-iterators commented 1 year ago

In the code for the contrast function, the farthest variable is set to: farthest: onWhite == max? .WHITE : .BLACK.

The max variable is set to Math.max(contrastOnBlack, contrastOnWhite);, and min is either contrastOnBlack or contrastOnWhite. So, comparing onWhite to contrastOnBlack or contrastOnWhite would be comparing two different things. So I think farthest should be changed to: farthest: contrastOnWhite == max? .WHITE : .BLACK