alafr / SVG-to-PDFKit

Insert SVG into a PDF document created with PDFKit
MIT License
397 stars 111 forks source link

hsl & hsla color formats not supported #187

Open petrkotek opened 2 months ago

petrkotek commented 2 months ago

Would be nice to add a support for HSL and HSLA:

hsl(hue, saturation, lightness)
hsla(hue, saturation, lightness, alpha)

Examples:

hsl(120, 50%, 50%)
hsla(120, 50%, 50%, 0.5)

This would be implemented in parseColor method: https://github.com/alafr/SVG-to-PDFKit/blob/b091ebd4e7b7d2310eb1003511cd5de480f7e0e1/source.js#L471

(Note: I should be able to implement this in the next few days.)