http://sidneys77crlfslcr7zmj3msmxchgnxhrxlp3p3kbaswo7twchjnicid.onion/programming/tips/2024/12/02/html5-canvas-tips.html
Default Canvas-Rendered Text, With HI-DPI Fix Opaque Canvas-Rendered Text, With HI-DPI and ClearType Fix Matching Background Colors on an Opaque Canvas When using an opaque canvas, the default fill color when initialized or when calling ctx.clearRect(...) is always #000 . If we want the canvas fill to match our page (assuming it’s a solid color), we can get the color with this
simple function: /**
* Returns the background color of the nearest ancestor that is not `none`