How to transform black into any given color using only CSS filters?
The answer:
Use simultaneous perturbation stochastic approximation to probabilistically obtain an approximation of the color through a chain of filter transforms...
stackoverflow.com/a/43960991
Web development.
Conversation
You may have noticed grapheneos.org now includes a logo in the navigation bar. The site reuses the same SVG with a mask of the GrapheneOS logo for the header, footer and Safari tab icon.
Setting the color to match the color of the text for the active page is ridiculous.
1
2
Can use codepen.io/sosuke/pen/Pjo to generate a filter chain closely approximately the color via the probabilistic algorithm above. Tweaking it to use a loop until it gets one with insignificant loss is simple enough and it doesn't take long.
How is the web this screwed up though?
Replying to
1
Replying to
It has serious issues with browser support despite being around since 2014:
caniuse.com/css-masks
I don't really want to rely on features that are behind prefixes and partially implemented. Currently only using one of those kinds of features and it's a minor optional thing.
1
1
Show replies

