scttcper / ngx-color

🎨 Color Pickers from Sketch, Photoshop, Chrome, Github, Twitter & more
https://ngx-color.vercel.app
MIT License
435 stars 55 forks source link

Feature request: adding helper method for converting ColorEvent to string and viceversa #333

Open RezaRahmati opened 3 years ago

RezaRahmati commented 3 years ago

Hi, first of all thank you for great work here.

I have a case that in admin panel I want to let user to choose the colors then store them in db, and later I will read from db and set some css variable at runtime.

The feature I am requesting is to add helper function or something to handle converting ColorEvent to string that can be stored and be used in frontend as valid color, (for example hsla(20, 50%, 100%, 0.5) ) and then converting back this string to HSLA | HSVA | RGBA | string that can be assigned to color input.

scttcper commented 3 years ago

You could use tinycolor, the color library this library uses https://github.com/scttcper/tinycolor#readme