How is the 【oklch】 palette compatible
The project used Tailwind CSS, but the color palette in Tailwind CSS 4.0 changed from rgb (red, green and blue) to oklch (Oklab Color Space), resulting in the following error when using html2canvas:
Error: Attempting to parse an unsupported color function "oklch"
Hi @lihongyao! I just forked and added support for OKLCH here: https://github.com/nicastelo/html2canvas.
It is ready to install from npm as npm install html2canvas-oklch.
I didn’t test it much tbh, but it worked fine for me.
I also sent a PR to this repo here: https://github.com/niklasvh/html2canvas/pull/3236, although I still need to write some tests before it can be merged -- That in case this is still maintained
still
Thank you very much~
@nicastelo I believe that the most up-to-date version is now ours. We welcome every contributor, as that lib is far from our roadmap.
try npmjs.com/package/html2canvas-pro, it supports color function oklch.