zefoy / ngx-color-picker

Color picker widget for the Angular (version 2 and newer)
MIT License
454 stars 142 forks source link

Exposing functions to convert from RGB to HEX etc. #347

Open MelanieW97 opened 10 months ago

MelanieW97 commented 10 months ago

Hey,

there must be some kind fo logic in your code to convert the RGB values to HEX and so on. Would it be possible to expose these functions for further use?

I want the user to be able to use the input as RGB, HEX, ... I don't mind. However, I need to convert the values to HEX when saving. It'd be nice to use the same functions since that should be less error-prone.

I can only find some of these functions:

There's only a function to convert rgba directly to hex. Or do you convert the color value to other values as well before you convert to hex? In that case, I can just do it the same way. I was just wondering if some functions are not being exported.

Thanks in advance. :)