Expand my Community achievements bar.

Nomination window for the Adobe Community Advisor Program, Class of 2025, is now open!
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

Level 10

With AEM - you can easily create a custom resource type to better meet your needs. For example - Adobe Experience Manager Help | Creating a custom Experience Manager sling:resourceType for Touch UI

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