Custom Color Picker Colors AEM 6.1
- March 12, 2016
- 2 replies
- 3583 views
I am trying to add custom colors to the Touch UI Granite Color Picker in a similar way it was done in the Classic UI.
In the classic ui you could do something like colors="[3A3A3A,563F9A,FFFFFF]" in the dialog and you would automatically only have those color values.
In the new ui I seem to only get the default colors and find no references provided by AEM Adobe on how to add them.
To make things worse most of the blogs I find show others writing their own JS files to overcome the inability to add custom colors.
How would I go about adding custom colors to the color picker?
Currently I have the basic code inside my .context.xml:
<bwtop jcr:primaryType="nt:unstructured" allowBlank="{Boolean}true" fieldDescritpion="Color" fieldLabel="Color" classicPaletteType="{Boolean}true" editType="{Boolean}true" name="./firstColor" sling:resourceType="granite/ui/components/foundation/form/colorpicker"/>Clicking on the color dialog portion gives me default box with 4 tabs starting with white, blue, and red. See dialog_color.png. (And decreasing alpha values...Which I don't understand why this is an option)
Changing classicPaletteType to false and freestylePaletteType to true, and vice versa, does nothing.
I have seen the following posts about this issue and have not found them helpful:
- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.html/forum__xkqd-my_team_is_havingpr.html
- http://experience-aem.blogspot.com/2015/01/aem-6-sp1-touchui-richtext-editor-color-picker-plugin.html
- http://experience-aem.blogspot.com/2015/10/aem-61-touchui-rich-text-editor-color-picker-plugin.html
- https://docs.adobe.com/docs/en/aem/6-1/ref/granite-ui/api/jcr_root/libs/granite/ui/components/foundation/form/colorpicker/index.html
If anyone can help it would be greatly appreciated.