This is an example of the sort of template I start with when creating graphics using <canvas>.

It transfers control to a worker and uses the display-p3 color space.

All code for this example is in this html file.

If you don't see a colorful image below this text, your browser likely does not support one of the aforementioned features.

I've omitted feature checks from the code, so any errors should be plainly displayed in your browser console.