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.
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
- Install Blockenberg. Install from WordPress.org and activate the plugin.
- Insert the block. Edit a page, click +, search for “Color Palette”, insert it. Category: Developers.
- Configure inspector controls that exist on this block. Open Layout. Set “Name”, “CSS Variable”, “Display”, “Columns”.
- 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
| Control | What the code does |
|---|---|
| Name | Text field in the inspector. |
| CSS Variable | Text field in the inspector. |
| Display | Select control; the chosen value is saved on the block. Options: Grid; List (horizontal). block.json default: grid. Saved as `layout`. |
| Columns | Numeric 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 Align | Select control; the chosen value is saved on the block. Options: Left; Center; Right. block.json default: left. Saved as `textAlign`. |
| Show Name | On/off toggle in the inspector. On by default. Saved as `showName`. |
| Show Hex | On/off toggle in the inspector. On by default. Saved as `showHex`. |
| Show RGB | On/off toggle in the inspector. Off by default. Saved as `showRGB`. |
| Show CSS Variable | On/off toggle in the inspector. Off by default. Saved as `showCssVar`. |
| Show Copy Button | On/off toggle in the inspector. On by default. Saved as `showCopyBtn`. |
| Copy Format | Select control; the chosen value is saved on the block. Options: HEX; RGB; CSS Variable. block.json default: hex. Saved as `copyFormat`. |
| Show Shadow | On/off toggle in the inspector. On by default. Saved as `showShadow`. |
| Show Border | On/off toggle in the inspector. Off by default. Saved as `showBorder`. |
| Show Title | On/off toggle in the inspector. Off by default. Saved as `showTitle`. |
| Title text | Text 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 Background | Color control in the inspector. block.json default: #ffffff. Saved as `labelBg`. |
| Name Text | Color 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 — Border | Color control in the inspector. block.json default: #e5e7eb. Saved as `borderColor`. |
| Colors — Title | Color control in the inspector. block.json default: #1e1e1e. Saved as `titleColor`. |
What the front-end script actually does
- The view script reads HTML data attributes: data-cssvar, data-format, data-hex, data-rgb.
When this is the right block
- Display brand color swatches with HEX, RGB, and CSS variable labels. Perfect for style guides and design systems — that is the job of Color Palette, not a generic content block.
- Use it when you need the editor control labeled “Name”, which exists on this block’s inspector.
- It matches pages about color, palette, swatch.
- Inserter grouping: docs sites, utilities, and developer landing pages.
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
Color Harmony
Pick a base color and instantly see complementary, triadic, analogous, and other harmonic palettes. Click any swatch to copy its hex value.
Color Mixer
Interactive color mixing tool. Pick two colors, blend them at any ratio, view the result in HEX/RGB/HSL, generate color harmonies, and copy any value instantly.
Color Thief
Upload an image to automatically extract its dominant color palette using canvas pixel analysis.
Color Tokens
Design-system colour token reference. Displays named colour swatches grouped into palettes (Primary, Neutral, Semantic, etc.) with hex/RGB values. Visitors can click any swatch to copy its hex code.
Contrast Checker
WCAG color contrast accessibility checker. Test foreground/background color combinations against AA and AAA standards.
CSS Gradient Generator
Interactive CSS gradient builder with live preview, multiple color stops, and one-click CSS copy.
Get Blockenberg
Install Blockenberg from WordPress.org, then insert Color Palette from the Gutenberg inserter.