OOTB Color Picker plugin not saving custom color | Community
Skip to main content
Himanshu_Singhal
Community Advisor
Community Advisor
August 5, 2018
Solved

OOTB Color Picker plugin not saving custom color

  • August 5, 2018
  • 4 replies
  • 3440 views

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.
Best answer by arunpatidar

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

4 replies

arunpatidar
Community Advisor
Community Advisor
August 6, 2018

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
Himanshu_Singhal
Community Advisor
Community Advisor
August 6, 2018

Thanks Arun.

Any sample code snippet would be of great help.

Regards,

Himanshu

smacdonald2008
Level 10
August 6, 2018

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

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
August 6, 2018

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