Tagged: colorpicker, custom colors, individual colors
-
AuthorPosts
-
May 15, 2023 at 5:42 pm #1407461
Hi,
I have defined my custom colors for the color picker in Enfold -> Layout Builder -> Custom Color Palette.
But when I try to use my custom colors for text in an ALB text element (which I use in PAGES) or the text of the classic editor (which I use in POSTS), then I do not see my defined colors.
In ALB text element when I try to make part of the text in color, it looks like this:
and in classic editor, when I try to make text colored, it looks like this:
No custom colors.
What snippet can I add to my site to define my custom colors?
Most plugins for that are outdated and I prefer to use as less plugins as possible.Thank you
May 16, 2023 at 6:52 am #1407510Hi BeeCee,
The palette that is changed when you set Custom Palette in Enfold Theme Options, is the color palette under Styling (tab) when you edit any element of the Advanced Layout Builder.
I tried to check how to change the custom color palette of WordPress Classic Editor however, it doesn’t seem to work. The only common recommendation I see on other posts is to use this plugin: https://wordpress.org/plugins/kt-tinymce-color-grid/ (which is a bit old)Best regards,
NikkoMay 18, 2023 at 5:11 pm #1407856The plugin is really old with 3 years. But I have found a snippet that works:
function my_mce4_options($init) { $default_colours = '"000000", "Black", "993300", "Burnt orange", "333300", "Dark olive", "003300", "Dark green", "003366", "Dark azure", "000080", "Navy Blue", "333399", "Indigo", "333333", "Very dark gray", "800000", "Maroon", "FF6600", "Orange", "808000", "Olive", "008000", "Green", "008080", "Teal", "0000FF", "Blue", "666699", "Grayish blue", "808080", "Gray", "FF0000", "Red", "FF9900", "Amber", "99CC00", "Yellow green", "339966", "Sea green", "33CCCC", "Turquoise", "3366FF", "Royal blue", "800080", "Purple", "999999", "Medium gray", "FF00FF", "Magenta", "FFCC00", "Gold", "FFFF00", "Yellow", "00FF00", "Lime", "00FFFF", "Aqua", "00CCFF", "Sky blue", "993366", "Red violet", "FFFFFF", "White", "FF99CC", "Pink", "FFCC99", "Peach", "FFFF99", "Light yellow", "CCFFCC", "Pale green", "CCFFFF", "Pale cyan", "99CCFF", "Light sky blue", "CC99FF", "Plum"'; $custom_colours = '"E14D43", "Color 1 Name", "D83131", "Color 2 Name", "ED1C24", "Color 3 Name", "F99B1C", "Color 4 Name", "50B848", "Color 5 Name", "00A859", "Color 6 Name", "00AAE7", "Color 7 Name", "282828", "Color 8 Name"'; // build colour grid default+custom colors $init['textcolor_map'] = '['.$default_colours.','.$custom_colours.']'; // enable 6th row for custom colours in grid $init['textcolor_rows'] = 6; return $init; } add_filter('tiny_mce_before_init', 'my_mce4_options');
Thanks, you can close this thread.
May 19, 2023 at 1:18 am #1407887Hi BeeCee,
Thanks for posting that information and we’re happy that you have found the code that works :)
Thanks as well for using Enfold and have a great day!Best regards,
Nikko -
AuthorPosts
- The topic ‘Color Picker with individual colors not working’ is closed to new replies.