Expand my Community achievements bar.

SOLVED

OOTB Color Picker plugin not saving custom color

Avatar

Community Advisor

Hi,

ColorPicker — Granite UI 1.0 documentation

I'm using color picker plugin in one of my component in AEM 6.4. After selecting a color and then editing color combination when I click on Save Color, it applies the edited color.

But, when I open the dialog next time, it shows white color selected by default.

Does anyone have idea, why color picker doesn't save custom color combination?

Regards,
Himanshu

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

Please find sample code at aem63app-repo/color-picker-fix.js at master · arunpatidar02/aem63app-repo · GitHub ,

Create a clientlib with category ='cq.authoring.dialog' for above

I've tested in 6.4 works for me.

you may need to update color picker property name in above code. I used './color'

Thanks
Arun



Arun Patidar

View solution in original post

4 Replies

Avatar

Community Advisor

Hi,

It could be a bug and the reason is when you edit colours it is getting saved as HEX value but if you choose from existing it saves as rgba function. To fix this you can write js code to convert HEX into rgba on dialog submit.

Thanks

Arun



Arun Patidar

Avatar

Community Advisor

Thanks Arun.

Any sample code snippet would be of great help.

Regards,

Himanshu

Avatar

Correct answer by
Community Advisor

Hi,

Please find sample code at aem63app-repo/color-picker-fix.js at master · arunpatidar02/aem63app-repo · GitHub ,

Create a clientlib with category ='cq.authoring.dialog' for above

I've tested in 6.4 works for me.

you may need to update color picker property name in above code. I used './color'

Thanks
Arun



Arun Patidar