GeneratePress

Set your own custom colors for the GeneratePress color picker

Get the latest from
Sniffle Valve

Sniffle Valve

Consider buying Sniffle Valve a coffee  

Book a one-on-one online training session

To save the the time and trouble of entering the same values over and over again for the colors in the GeneratePress color picker, add the code below to a Code Snippets snippet. Set the snippet to ‘Only run in administration area’.

The eight color values in the code are hexadecimal (HEX) values which you can determine from your graphics software or from an online source, such as W3Schools. The order in the code, top to bottom, is the order in the color picker left to right.

Thanks to Tom Usborne from GeneratePress for this.

image

add_filter( 'generate_default_color_palettes', 'tu_custom_color_palettes' );
function tu_custom_color_palettes( $palettes ) {
	$palettes = array(
		'#000000',
		'#FFFFFF',
		'#DC143C',
		'#008000',
		'#00008B',
		'#006400',
		'#808080',
		'#FFA500',
	);
	
	return $palettes;
}

2 thoughts on “Set your own custom colors for the GeneratePress color picker”

Leave a Comment

Your email address will not be published. Required fields are marked *