WordPress Block Editor - Block Settings: Color

WordPress Block Editor – Block Settings: Color

WordPress Block Editor - Block Settings: ColorThis tutorial is part of our series on using common block settings in the WordPress Block Editor Settings Section.

In this tutorial, you will learn how to customize a block’s color settings.

For a complete understanding of how to use the WordPress Block Editor, see the other tutorials in this series:

***

Block Settings – Color

Many types of blocks allow you to customize and edit their color settings.

WordPress Block Editor - Block Settings - Color
Customize a block’s color settings in the Block Settings panel of the WordPress Block Editor.

info

Note: Block types that support color properties must be selected in the content editor area to display the Color settings in the Block Settings panel.

If you need help using block settings, see this tutorial: WordPress Block Editor: Block Settings

Color Properties

You can edit and customize settings and options for the following properties in blocks that support color:

  • Text – Set the color of the selected text.
  • Background – Set the background color of the selected block.
  • Link – Set the color of links in the selected block

Additionally, WordPress gives you control of your block’s color settings by providing a color picker tool with the three main color models used to define color in web content: RGB, HSL, and Hex.

  • Hexadecimal (Hex) is a color model that represents colors using a combination of six hexadecimal digits (0-9 and A-F) that represent the intensity of each of the three primary colors in the RGB model. Each pair of digits represents the intensity of one of the primary colors, with the first two digits representing red, the middle two digits representing green, and the last two digits representing blue. For example, pure red would be represented as #FF0000, while pure green would be #00FF00 and pure blue would be #0000FF.
  • RGB stands for Red Green Blue, which is an additive color model that describes how different combinations of red, green, and blue light can create different colors. In this model, each color is represented by three numbers that range from 0 to 255, which correspond to the intensity of each of the primary colors. For example, pure red would be represented as (255, 0, 0), while pure green would be (0, 255, 0) and pure blue would be (0, 0, 255).
  • HSL stands for Hue Saturation Lightness, which is a color model that describes how colors can be represented by their hue (the color itself), saturation (how much of the color is present), and lightness (how bright or dark the color is). In this model, each color is represented by three values: a hue value (from 0 to 360 degrees), a saturation value (from 0 to 100%), and a lightness value (from 0 to 100%). For example, a bright red color might be represented as (0, 100%, 50%), where the hue value of 0 degrees represents pure red, the saturation value of 100% represents full intensity, and the lightness value of 50% represents a medium level of brightness.

Notes:

  • The WordPress color picker tool uses the RGBA color model (an extension of the RGB color model), and the HSLA color model (an extension of the HSL color model), where the “A” stands for Alpha.
  • In both the RGBA and HSLA color models, each color is represented by four values: the three values of RGB or HSL, and an Alpha value, which represents the opacity or transparency of the color.
  • Alpha values range from 0 to 100, where 0 represents complete transparency (the color is completely invisible) and 100 represents complete opacity (the color is completely visible). When the Alpha value is set to 50, for example, the color is partially transparent, and anything behind it will show through to some extent.
  • This extended color model is used in web design to create a transparent or semi-transparent background color for an element on a webpage without obstructing the content behind it, like an image watermark.
  • Every color displayed in the color picker tool has a name and a color code (Hex).

In the example below, the selected text color is Vivid red and its color code (or Hex code) is CF2E2E.

WordPress Block Settings: Color Settings - Text
WordPress gives you unlimited color optimization options with Color settings.

info

If you create a color using a different color model like RGBA, the color name will show up as “Custom” and the Hex code will be longer than 6 digits to accommodate the opacity of the color settings.

In the screenshot below for example, you can see that creating transparent text is possible (e.g. using the RGBA color model), but you will see a warning displayed that “Transparent text may be hard for people to read.” Use this option wisely.

WordPress Block Settings: Color Settings - Text
You can create transparent text, but it may be hard for people to read.

Color Settings

The tutorial below shows you how to customize and edit the default settings in blocks that support colors, including using the color picker tool to specify colors using different color models and color selectors.

Note: A block’s color settings may include additional options depending on which blocks you select and what plugins and themes are installed on your site.

Color Settings: Text

To set the text color of a block:

  1. Select the block
  2. Select the Block settings panel to view the Color settings option
  3. Click on Text.
Color settings option in the Block settings panel.
Select a block that supports color properties to view the Color settings option in the Block settings panel and click on Text to change the text color.

A pop-up panel containing the following options will display:

  1. Color Picker – allows you to specify the color of your choice using the built-in color picker.
  2. Theme Color Palette – displays colors from the color palette associated with your active theme. Note that many newer block themes let you easily change their entire color palette, which affects the color options displayed in the Theme section of the popup panel.
  3. Default – displays default colors set by the WordPress software installation on your site.
WordPress Block Settings: Color Settings -Text color popup properties
There are various ways to change your text color in the Color settings popup tool.

Clicking on the transparent rectangle area brings up the Color Picker.

WordPress Block Settings: Color Settings - Color Picker
Use the Color Picker tool to define a specific color for your text.

Use the color picker to select a color by dragging your cursor over the color fields or by entering a value in the color properties field.

Animated gif showing how to use the Color Settings color picker tool.
How to use the Color Settings color picker tool.

The rectangle will be filled with your chosen color and the color of your text will be changed accordingly.

Adding color to text using the Color Picker tool.
Add color to your text using the Color Picker tool.

Instead of using the color picker, you can also simply select one of the color options from either the Theme or Default palette.

Color settings: Selecting a color from the Default pallet.
Selecting a color from the Default pallet.

Note: You don’t need to select the text in a block to change the text color. Simply select the block, choose a color, and it will be automatically applied to the block’s text.

Animated gif showing how to select text colors using the Default color palette.
You can choose a default color for your text.

Remember to save your work after making changes to update your block’s color settings.

Note: It is currently not possible to change the text color for individual words or letters in a block using the block’s Color settings, as these settings apply globally to the entire block.

As an example, to create this multicolored word… Chameleon

You would need to use either the Custom HTML block or compose your content in the WordPress Classic Editor.

Using Custom HTML block to create multicolored words.
Use the Custom HTML block or the WordPress Classic Editor to add different colors to text in a block instead of the Color Settings options.

Color Settings: Background

You can change the background color of a block that supports color options by selecting Background in the Color settings box.

To select the Background option:

  1. Select the block
  2. Select the Block settings panel to view the Color settings option
  3. Click on Background.
WordPress Block Color Settings: Background color options.
Use the block’s color settings to add background colors.

Selecting the Background setting gives you a choice of using a Solid background color or adding a Gradient.

Color settings: adding a background color to a block
There are various options available to add a background color to a block.

Adding A Solid Background Color To A Block

To add a solid background color to a block:

  1. Select the block you want to add a background color to in the content editor.
  2. Switch to the Block settings panel to view the Color settings box.
  3. Click on Background in the Color settings.
  4. Select the Solid tab in the Color panel pop-up window.
  5. Choose a solid color background from either the Theme or the Default color palettes.
  6. A solid-colored background will be applied to your selected block.
Animated gif of WordPress Block Color Settings showing options for adding background colors to blocks.
Add a solid background color to a block.

Note: If WordPress detects accessibility issues with the color you have selected, it will display the following warning message: “This color combination may be hard for people to read. Try using a brighter background color and/or a darker text color.” 

Accessibility warning displayed when color combinations are hard for people to read.
Avoid choosing color combinations that are hard for people to read. WordPress warns you about possible accessibility issues.

If you see this warning, consider choosing colors that will be easier for users to read.

Adding A Gradient Background To A Block

To add a gradient background to a block:

  1. Select the block to add color to in the content editor.
  2. Switch to the Block settings panel to view the Color settings box.
  3. Click on Background in the Color settings box.
  4. Select the Gradient tab in the Color panel pop-up window.
  5. Create your own Gradient using the sliders in the color picker and choosing the Gradient Type (Linear or Radial), or choose a gradient background from either the Theme or the Default color palettes.
  6. A gradient background will be applied to your selected block.
WordPress Block Color Settings - Background color Gradient tab.
Add preset or custom gradients as background colors in blocks using the Gradient tab.

The color picker gives you precise control over your gradient’s colors.

Animated gif showing different options for Gradient tool.
The Gradient tool gives you endless gradient customization options for adding background colors.

You can choose colors using the sliders and fine-tune these using additional options, such as the Gradient Type (Linear or Radial).

Notes:

Selecting the following Gradient Type:

  • Linear – lets you specify the gradient angle by either inputting a value into the Angle field or by adjusting the angle dial button.
  • Radial – lets you move the sliders in or out to adjust your radial gradient effect.
WordPress Block Color Settings - Radial Gradient
Adjust the control points to change the gradient’s radial effect.

You can also add multiple control points to gradients to create a multicolored gradient background for your block.

Just click on the Gradient tool to add a new control point to your gradient.

WordPress Block Color Settings - Adding a new control point to a gradient.
Click on the Gradient tool to add a new control point.

You can create eye-catching multicolored gradients by adding multiple points to the gradient tool and adjusting your color settings.

Multicolored gradient background on a text block.
Create multicolored gradient backgrounds using the Gradient tool and multiple control points.

There are a number of ways to adjust and finetune your gradients.

For example, you can choose the Gradient Type you want for your gradient and adjust settings like slider spacing, angles, etc.

WordPress Block Color Settings - Gradient Type options.
Select a Linear or Radial Gradient Type.

Adjust the angles of your gradient using the gradient value field or dial feature (or a combination of both).

Animated gif showing different options for setting gradient angles.
Set gradient angles by typing in the angle or adjusting the dial.

As shown in the image below, adjusting the angle of a gradient affects the entire gradient, not its individual control points. You can preview your changes in real time.

Animated gif showing effect of adjusting gradient angles.
View the changes made to the angles of your gradients in realtime.

You can also use the color picker to edit and adjust the color of your newly added gradient point.

Simply click on a control point and adjust the settings.

Gradient tool with control point selected.
Click on a control point to adjust its settings.

You can also use different color systems to select your gradient colors using the dropdown menu.

Gradient tool color system options in dropdown menu.
Use different color systems like Hex, RGB, or HSL to choose your colors.

For example, if you choose RGB (Red, Green, and Blue), enter values from 0-255 into each of the fields or adjust the sliders to create the color.

As mentioned earlier, the WordPress Color settings tool uses the RGBA color model (Red, Green, Blue, Alpha), where A sets the opacity on a scale of 0 (full transparency) to 100 (full opacity)

WordPress Block Color Settings - Color picker: RGBA values.
Set the color by adjusting RGB+A values in the color picker.

Similarly, enter values into each of the fields or adjust the sliders to create a color if you choose the HSL (Hue, Saturation, and Lightness) color model. Use “A” (Alpha) to adjust the opacity.

WordPress Block Color Settings - Color picker: HSL values.
Set the color by adjusting HSL+A values in the color picker.

You can also copy the color values to your clipboard using the Copy button.

WordPress Block Color Settings - copy color values button.
Click the Copy button to copy your selected color values to your clipboard.

The function to copy and paste color values is useful if you want to duplicate colors across different blocks, create a branding guide for your team, communicate color choices with designers, etc.

WordPress Block Color Settings - color values copied.
The ability to copy and paste your color values can be useful.

As you experiment with different colors, note that the icon for the Color settings option updates dynamically to reflect the chosen colors. This gives you an ‘at a glance’ view of the color scheme you are creating when you switch between the block Color settings.

WordPress Block Color Settings - Color settings icon.
The Color Settings icon of the element you are working on updates automatically as you edit its color options.

You can also remove any additional control points in your gradients by selecting the point in the Gradient tool and clicking on the Remove Control Point link.

WordPress Block Color Settings - Remove Control Point
Click ‘Remove Control Point’ to remove any additional control points added to your gradient.

Remember to save your work after making changes to update your block’s color settings.

Color Settings: Link

In addition to setting colors for a block’s text and background, you can set a color for links by selecting Link in the Color settings box.

To select the Link option:

  1. Select the block,
  2. Select the Block settings panel to view the Color settings option,
  3. Click on Link.
WordPress Block Color Settings - Link color settings
Click on Link to change your block’s link color settings.

Select the link color from the Theme or Default color palettes.

When you link text inside the block it will inherit the color you’ve set.

WordPress Block Color Settings - Link color settings.
Customize the color of your links inside the block.

Remember to save your work after making changes to update your block’s color settings.

Resetting Color Options To Default Settings

You can reset your color properties to their default state individually or all at once.

To reset Color options for a block, click on the ellipsis symbol on the right-hand side of the Color settings box.

If a color has been set for an element of the block (text, background, or link), you will see a “minus” symbol (i.e. a dash).

Click on the minus symbol to clear the settings for an individual option.

WordPress Block Color Settings - Remove color settings
Remove color settings for individual elements by clicking on the ‘minus’ symbol.

To reset all color settings for a block to their default state, repeat the above process and click on the ellipsis symbol on the right-hand side of the Color settings box to bring up the reset options.

This time, however, click on the Reset all button.

WordPress Block Color Settings - Reset all color settings
Reset all color settings for your block with one click.

All color options for the block will be reset to their default state.

Removing Block Color Settings
Easily remove and reset your block Color settings.

WordPress Block Editor Color Settings – FAQs

Here are frequently asked questions about WordPress Block Editor Color settings:

How can I change the text color of a block in the WordPress Block Editor?

To change the text color of a block, select the block you want to modify, then navigate to the block settings panel on the right-hand side. Look for the “Color” or “Text Color” option, where you can choose from preset colors or define a custom color using a color picker.

Are there options to change background colors for blocks in the Block Editor?

Yes, many blocks in the WordPress Block Editor offer settings to change the background color. Locate the block settings panel and look for the “Background Color” option, where you can select predefined colors or specify a custom background color.

Can I apply different colors to different parts of a block, such as headings or paragraphs?

Yes, the Block Editor allows users to apply different colors to various parts of a block. For instance, you can set different text colors for headings and paragraphs within a block by selecting each element individually and adjusting their color settings.

Do WordPress themes affect color options in the Block Editor?

Yes, WordPress themes can influence color options in the Block Editor. Some themes may provide additional color customization features or override default color settings to maintain consistency with the theme’s design.

Are there advanced color customization options available for developers?

Developers can utilize CSS customizations or theme.json files to implement advanced color customization options for blocks in the Block Editor. These methods allow for precise control over colors, including gradients and opacity.

How can I reset color settings for a block to default?

To reset color settings for a block to default, locate the color settings panel for the block and look for a “Reset” or “Default” button. Clicking this button will revert the color settings to their original state.

***

Congratulations! Now you know how to adjust your block’s color settings.

Additional Block Settings

Click on a tutorial from the list below to learn about using other common block settings in the WordPress block editor.

***

For more tutorials in this series, go here:

***

Print Friendly, PDF & Email

Updated: April 23rd, 2024

Terms Of Use | Privacy Policy

Scroll to Top