The color contrast check should use the most contrasting pixel instead of the average
The current behavior to average foreground color to check for contrast seems wrong.
- correct behavior is to determine most contrasting pixel value
- fix is to find foreground darkest and lightest pixel and compute ratio w/ background, then take the larger ratio value
Hi Nan, thanks for the PR. A couple of comments: taking the most contrasting pixel values has its own disadvantages since most contrasting pixels may be fewer in number (especially when text is anti aliased), I suggest creating a new contrast check that uses your algorithm leaving the existing check as is.
Hi Nan, thanks for the PR. A couple of comments: taking the most contrasting pixel values has its own disadvantages since most contrasting pixels may be fewer in number (especially when text is anti aliased), I suggest creating a new contrast check that uses your algorithm leaving the existing check as is.
Thanks for your response. I'll update it with a new rule.
@j-sid Can you take another look? Thanks!