Billy Messenger
Billy Messenger
I've also been thinking of how to better integrate this. For one, we can probably have the renderer automatically detect if it should use `DarkOnLight` mode or `LightOnDark` mode by...
> Here's what light text on a dark background looks like with `let corrected_coverage = 1.0 - pow(1.0 - coverage, 0.7);`: Actually looking back on this it looks a little...
I noticed that `let corrected_coverage = 1.0 - sqrt(1.0 - coverage);` actually makes light text on dark backgrounds look a bit dimmer than its intended color, so scaling it up...
And playing around more with dark text on light backgrounds, I think the equation `let corrected_coverage = min(1.0, sqrt(coverage) * 1.11);` gives better results.
Oh actually, I just made a new discovery. I discovered that the `let corrected_coverage = 2.0 * coverage - coverage * coverage;` for dark text on a light background was...
Using `let corrected_coverage = pow(coverage, 1.4);` for light text on a dark background also works quite well, and seems better at preserving the intended color.
Or wait, perhaps using `sqrt` would be better than `pow` for performance reasons.
Apparently `sqrt` is actually quite cheap on GPUs.
I've found that `let corrected_coverage = 1.0 - sqrt(min(1.0, max(0.0, 1.0 - (coverage * 1.2))));` seems to work the best for preserving the intended color for light text on a...
This piecewise approximation seems to work very well for light text on a dark background too: ``` let part_1 = 0.67 * coverage; let part_2 = coverage - 0.14; let...