-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
Milestone
Description
Currently if contrast can't be met going the natural direction, we switch and go the other direction but this is done by using the background as the foreground:
Code:
Lines 197 to 201 in 384cd9d
| if (resultARatio < ratio) { | |
| const resultB = increaseLuminance(bgRgba, bgRgba, ratio); | |
| const resultBRatio = contrastRatio(bgL, rgb.relativeLuminance(resultB >> 8)); | |
| return resultARatio > resultBRatio ? resultA : resultB; | |
| } |
Lines 206 to 210 in 384cd9d
| if (resultARatio < ratio) { | |
| const resultB = reduceLuminance(bgRgba, bgRgba, ratio); | |
| const resultBRatio = contrastRatio(bgL, rgb.relativeLuminance(resultB >> 8)); | |
| return resultARatio > resultBRatio ? resultA : resultB; | |
| } |
More ideal would be to retain the hue of the original color, so we would continue to use fgRgba here which should make the folder above still have a blue hue and the branch still have a yellow hue.
Reactions are currently unavailable
