Closed Smus closed 7 years ago
Nevermind, found them in evol.colorpicker.js :)
hmm or maybe not :-( That wasnt the correct place
mosaico currently depends on evol colorpicker 3.2.1 and "embeds" evol 3.2.1 in the "compiled" output. evol colorpicker 3.2.1 doesn't support overriding the palette via configuration.
Newer colorpicker (https://github.com/evoluteur/colorpicker/blob/master/js/evol-colorpicker.js#L211) added support for "customTheme" option, but I didn't have time to check if the newer colorpicker is compatible with mosaico.
Hmm, is this solved? I need to do exactly this - add a custom palette with company colors. And can't really figure out if this is supposed to be a solution, or just stating it doesn't work.
+1 to this enhancement. Can it be reopened?
Try declaring a custom color widget:
var colorWidgetPlugin = {
widget: function($, ko, kojqui) {
return {
widget: 'color',
html: function(propAccessor, onfocusbinding, parameters) {
return '<input size="7" type="text" data-bind="colorpicker: { color: ' + propAccessor + ', customTheme: WHATYOUWANT, strings: $root.t(\'Theme Colors,Standard Colors,Web Colors,Theme Colors,Back to Palette,History,No history yet.\') }, ' + ', ' + onfocusbinding + '" />';
}
};
}
};
The pass this plugin to the mosaico init. Let us know.
@bago could You share more specific example, where and how include plugin ?
Is it possible to change the default colors for the color picker?