Developers · Gutenberg

Color Palette block for WordPress

Display brand color swatches with HEX, RGB, and CSS variable labels. Perfect for style guides and design systems.

Get Blockenberg

Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.

Get Blockenberg

What it actually does

Display brand color swatches with HEX, RGB, and CSS variable labels. Perfect for style guides and design systems.

Inspector panels on this block: Layout, Labels & Copy, Card Style, Section Title. Those titles come from index.js, not from a shared template.

Behavior controls: “Display” options: Grid, List (horizontal); “Text Align” options: Left, Center, Right; “Copy Format” options: HEX, RGB, CSS Variable.

Where to find it

Gutenberg inserter → Developers → search “Color Palette” (block name `blockenberg/color-palette` in block.json). Style it in the sidebar after insert.

How to use Color Palette block for WordPress

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “Color Palette”, insert it. Category: Developers.
  3. Configure inspector controls that exist on this block. Open Layout. Set “Name”, “CSS Variable”, “Display”, “Columns”.
  4. Check the published page. The view script reads HTML data attributes: data-cssvar, data-format, data-hex, data-rgb. The block editor preview may not run the same view script.

Inspector controls from this block’s code

ControlWhat the code does
NameText field in the inspector.
CSS VariableText field in the inspector.
DisplaySelect control; the chosen value is saved on the block. Options: Grid; List (horizontal). block.json default: grid. Saved as `layout`.
ColumnsNumeric range control in the inspector. Range 1–8. block.json default: 3. Saved as `columns`.
Swatch Height (px)Numeric range control in the inspector. Range 40–300. block.json default: 120. Saved as `swatchHeight`.
Gap (px)Numeric range control in the inspector. Range 0–48. block.json default: 16. Saved as `gap`.
Border Radius (px)Numeric range control in the inspector. Range 0–32. block.json default: 12. Saved as `borderRadius`.
Label Padding (px)Numeric range control in the inspector. Range 4–32. block.json default: 12. Saved as `labelPadding`.
Text AlignSelect control; the chosen value is saved on the block. Options: Left; Center; Right. block.json default: left. Saved as `textAlign`.
Show NameOn/off toggle in the inspector. On by default. Saved as `showName`.
Show HexOn/off toggle in the inspector. On by default. Saved as `showHex`.
Show RGBOn/off toggle in the inspector. Off by default. Saved as `showRGB`.
Show CSS VariableOn/off toggle in the inspector. Off by default. Saved as `showCssVar`.
Show Copy ButtonOn/off toggle in the inspector. On by default. Saved as `showCopyBtn`.
Copy FormatSelect control; the chosen value is saved on the block. Options: HEX; RGB; CSS Variable. block.json default: hex. Saved as `copyFormat`.
Show ShadowOn/off toggle in the inspector. On by default. Saved as `showShadow`.
Show BorderOn/off toggle in the inspector. Off by default. Saved as `showBorder`.
Show TitleOn/off toggle in the inspector. Off by default. Saved as `showTitle`.
Title textText field in the inspector. Saved as `title`.
Title Size (px)Numeric range control in the inspector. Range 14–48. block.json default: 20. Saved as `titleSize`.
Card BackgroundColor control in the inspector. block.json default: #ffffff. Saved as `labelBg`.
Name TextColor control in the inspector. block.json default: #1e1e1e. Saved as `labelTextColor`.
Meta Text (hex/rgb)Color control in the inspector. block.json default: #6b7280. Saved as `labelMeta`.
Colors — BorderColor control in the inspector. block.json default: #e5e7eb. Saved as `borderColor`.
Colors — TitleColor control in the inspector. block.json default: #1e1e1e. Saved as `titleColor`.

What the front-end script actually does

When this is the right block

Notes from the implementation

viewScript: this folder’s frontend.js is enqueued on the front end for this block.

FAQ

How do I add the Color Palette block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Color Palette”. It sits under Developers. After insert, open Layout and set “Name”, “CSS Variable”, “Display”, “Columns”.

What makes Color Palette different from other Blockenberg blocks?

Display brand color swatches with HEX, RGB, and CSS variable labels. Perfect for style guides and design systems. Inspector labels on this block include “Name”, “CSS Variable”, “Display”, “Columns”.

Is the Color Palette Gutenberg block free?

Yes. Color Palette ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.

Can I style Color Palette to match my theme?

Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: Layout, Labels & Copy, Card Style, Section Title).

Related developers blocks

Get Blockenberg

Install Blockenberg from WordPress.org, then insert Color Palette from the Gutenberg inserter.

Get Blockenberg