• Skip to primary navigation
  • Skip to main content
  • Skip to footer
Nutty Hiker Adventures Logo

Nutty Hiker Adventures

Hike Every Hike Like It Is Your Last

  • Hiking >>
    • Hiking Articles
    • Hiking 101 >
      • 10 Essentials of Hiking
      • Types of Hikes
      • Trail Etiquette
      • Hiking Terms & Jargon
      • Hiking First Aid Kit
      • What to Bring On Every Hike
      • Pre Thru-Hike Checklist
      • Hacks to Lighten Your Backpack Weight
      • How to Avoid Norovirus While Backpacking
      • Choosing a Sleeping Bag Liner
      • How to Poop in the Woods
      • Gift Guide for Hikers
      • Books for Hikers & Backpackers
      • Movies About Hiking
      • Subscription Boxes for Hikers
      • Thru-Hiking Trails Bucket List – USA Edition
      • Your Hiking Questions Answered
    • Long Trails >
      • Appalachian Trail
      • BamatoBaxter
      • Greenbrier River Trail
      • Lone Star Hiking Trail
      • Pinhoti Trail
    • Rails To Trails >
      • Greenbrier River Trail
    • Gear Reviews
    • Ask Nutty Hiker
  • Camping >>
    • Camping Articles
    • Camping Gear Reviews
  • Survival >>
    • Survival Articles
    • Survival Gear Reviews
  • Destinations >>
    • By State >>
      • Arizona
      • Arkansas
      • Colorado
      • Georgia
      • Idaho
      • Kansas
      • Kentucky
      • Louisiana
      • Maryland
      • Nevada
      • New Mexico
      • North Dakota
      • Oklahoma
      • Pennsylvania
      • South Dakota
        • Black Hills National Forest
      • Tennessee
      • Texas
        • North Texas
        • Central Texas
          • San Antonio
        • East Texas
        • South Texas
        • West Texas
        • Texas State Parks
        • Guadalupe Mountains National Park
      • Utah
      • Virginia
      • Washington
      • West Virginia
    • The Ultimate Road Trip Checklist || Adventure Safely
    • Road Trips >>
      • The Ultimate Road Trip Checklist || Adventure Safely
      • Road Trip Ideas
    • State Highpoints
    • National Parks & Forests >
      • Black Hills National Forest
      • Guadalupe Mountains National Park
  • Motorcycle >>
    • Sturgis 2024
  • Photography >>
    • Latest Work
    • Photography Gear Reviews
    • Portrait Portfolio
  • ✎ Logbook >>
    • My Daily Antics
    • Ask Nutty Hiker
    • News >>
      • Outdoor News
      • Interviews
    • Resources >>
      • Recommendations
      • The Ultimate Road Trip Checklist || Adventure Safely
      • Hiking Essentials Checklist
      • Morse Code Converter || Send a Message in Morse Code
      • Military Time Converter
      • Message Encryption & Decryption
      • Message Transformer
  • Shop
    • My Artwork
    • Merch Store (T-Shirts & More)
  • Video’s
You are here: Home / The Logbook / How to Add Custom Colors to the Color Palette in Gutenberg

How to Add Custom Colors to the Color Palette in Gutenberg

November 20, 2019 by Nutty Hiker Last Modified: July 20, 2020Leave a Comment

You may have noticed in Gutenberg (WordPress) you have the ability to choose a color from the color palette for the background or text color of the block you are working on under color settings on the right-hand side.

You will see predefined colors and an option (if your theme allows the ability) to pick a custom color from the color palette like below:

Color palette in Gutenberg WordPress

Wouldn’t it be cool if you could have your custom colors already predefined instead of using the predefined colors that come with your theme without using a plugin?

Well, you can, and it is as simple as editing the functions.php file (I suggest creating a child theme so that way if your main theme updates it will not override these edits) and adding some css to the custom css section.

Adding Custom Colors to the Color Palette

Step 1

Go to Appearance >> Theme Editor >> functions.php

Add the following:

// Adds support for editor color palette.
add_theme_support( 'editor-color-palette', array(
	array(
		'name'  => __( 'Light gray', 'themename' ),
		'slug'  => 'light-gray',
		'color'	=> '#f5f5f5',
	),
	array(
		'name'  => __( 'Medium gray', 'themename' ),
		'slug'  => 'medium-gray',
		'color' => '#999',
	),
	array(
		'name'  => __( 'Dark gray', 'themename' ),
		'slug'  => 'dark-gray',
		'color' => '#333',
       ),
) );

You will notice code above adds a light gray, medium gray, and dark gray color. You can add more colors by repeating the following before the ) ); at the end.

array(
		'name'  => __( 'Dark gray', 'themename' ),
		'slug'  => 'dark-gray',
		'color' => '#333',
       ),

Make sure to change ‘themename’ to the name of your theme. You can usually scroll up in the functions file and find the name of the theme.

Name = This is what you will see when you scroll over the color in the editor

Slug = This needs to be a unique name

Color = Here you will put the hex color (you can find hex color values here)

Step 2 – Add the CSS

Go to Appearance >> Edit Css

Add the following:

/** CUSTOM COLOR PALETTE **/
.has-ColorNameHere-color {
    color: #f5f5f5;
}

You will need to add the following for EACH color

.has-ColorNameHere-color {
color: #f5f5f5;
}

Make sure to replace ColorNameHere with the slug of the color in your functions.php file and replace the #f5f5f5 with your color hex number that corresponds to that color slug.

Example functions.php code:

// Adds support for editor color palette.
add_theme_support( 'editor-color-palette', array(
	array(
		'name'  => __( 'Light gray', 'mytheme' ),
		'slug'  => 'light-gray',
		'color'	=> '#f5f5f5',
	),
	array(
		'name'  => __( 'Medium gray', 'mytheme' ),
		'slug'  => 'medium-gray',
		'color' => '#999',
	),
	array(
		'name'  => __( 'Dark gray', 'mytheme' ),
		'slug'  => 'dark-gray',
		'color' => '#333',
       ),
) );

Example of the corresponding CSS for the Css file:

/** CUSTOM COLOR PALETTE **/
.has-light-gray-color {
    color: #f5f5f5;
}
.has-medium-gray-color {
    color: #999;
}
.has-dark-gray-color {
    color: #333;
}

Disclaimer: This post is for informational / educational purposes only. Opinions expressed in this post are not intended to provide specific financial, legal, or medical advice / recommendation. Bridget is not a lawyer, financial advsior, medical professional, therapist, astronomer or palm reader. You use this information in this post and elsewhere on the site at your own risk. This information on this site should not be taken as any type of professional advice. You should always consult a professional for any kind of legal, medical, or financial advice.

Filed Under: The Logbook

About Nutty Hiker

Bridget (known as Nutty Hiker on the trail) is a former journalist and newspaper editor turned professional wildlife/landscape photographer and outdoor adventure extraordinaire. She is also the face behind Nutty Hiker Adventures and has been a blogger since 2001! She loves to spend her time out on the trails racking up miles =) You can read more about her here.
FOLLOW: Facebook | TikTok | YouTube

Reader Interactions

Leave a Comment or Suggestion Cancel reply

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

Footer

FOLLOW

  • Facebook
  • Instagram
  • YouTube
  • RSS Feed
  • Amazon
  • Patreon

TIP JAR =)

This blog is my full-time job. I rely heavily on support from my readers. If you found my content useful and would like to help offset the cost of running this blog and my nutty adventures, please feel free to leave something in one of the tip jars below =)
PayPal
Cash App
Venmo

DISCLOSURE

Per the FTC, This website contains affiliate links, advertisements, and sponsored posts. For reviews, I was provided with a complimentary copy of the item unless otherwise stated. As an Amazon Associate, I earn from qualifying purchases using the amazon links located on my website. Read my full policy here.

AWARDS/ASSOCIATIONS

OWAA Member Logo
Best Outdoor Blogs Feedspot Best Hiking Blogs

Copyright © 2026 — Nutty Hiker Advenures | Bridget Carlson • All rights reserved.
The links on this website are solely for the convenience of our visitors. Nutty Hiker does not endorse, operate, or control external websites.
Terms of Use • Privacy Policy• Disclosure• Contest Rules

  • Home
  • About
  • Subscribe
  • ☕ Support
  • ✉ Contact
  • Blog Archives
  • Recommendations
  • >> Resources