OOTB Color Picker plugin not saving custom color | Community
Skip to main content
Himanshu_Singhal
New Participant
Aug 5, 2018 6:56 PM UTC
Solved

OOTB Color Picker plugin not saving custom color

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
arunpatidar
arunpatidarAccepted solution
New Participant
Aug 6, 2018 10:38 PM UTC

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

4 replies

arunpatidar
arunpatidarAccepted solution
New Participant
Aug 6, 2018 10:38 PM UTC

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

Translate
Arun Patidar
smacdonald2008
Level 10
Aug 6, 2018 7:02 PM UTC

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

Translate
Himanshu_Singhal
New Participant
Aug 6, 2018 6:45 PM UTC

Thanks Arun.

Any sample code snippet would be of great help.

Regards,

Himanshu

Translate
arunpatidar
New Participant
Aug 6, 2018 7:59 AM UTC

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

Translate
Arun Patidar