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?
1
3
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.
The grapheneos.org footer is placed at the bottom of the viewport even when there isn't enough content to fill the page. We don't use any JavaScript for page styling or workarounds so we actually have to do these things properly with CSS. It's another example of pain.
1
Using 100vh as min-height is our baseline approach but that doesn't actually work consistently / properly. We need the CSS stretch feature (formerly called fill-available and fill, forget the exact history) which isn't fully standardized yet so it's as -webkit-fill-available.
1
Show replies

