bricks_update_color

Phase 2BeginnerComplexity: 3/10
Update an existing color in the palette

Overview

Updates an existing color in the Bricks color palette. Only the provided fields are changed — omitted fields remain unchanged. Use this to modify a color’s hex value, name, dark mode variant, CSS variable name, or utility class configuration.

After updating, call bricks_regenerate_assets to recompile CSS with the new color values.

Key Features

Partial update
Only updates the fields you provide — other properties remain unchanged
Dark mode toggle
Add or update the dark_hex value for Bricks 2.2+ dark mode support

When to Use

Changing an existing color's hex value (e.g., adjusting brand colors)
Adding or updating a dark mode hex variant
Renaming a color or changing its CSS variable
Updating utility class configuration for a color
Prerequisites
The color must already exist — get its color_id from bricks_get_color_palette
Run bricks_get_color_palette first to find the color_id

When NOT to Use

When creating a new color — use bricks_create_color instead
For bulk color changes — consider deleting and recreating with bricks_create_color_palette

Parameters

6 Total Parameters1 Required5 Optional
color_idstringREQUIRED
ID of the color to update (from bricks_get_color_palette)
namestringoptional
New display name
hexstringoptional
New hex color value (light mode)
dark_hexstringoptional
Dark mode hex value (Bricks 2.2+)
css_variablestringoptional
New CSS variable name
utility_classesarrayoptional
Updated utility class types
Values: bg, text, border, outline, fill, stroke

Code Examples

Update a color hex value

Change the primary color to a new shade

JSON
{
    "color_id": "abc123",
    "hex": "#3a51de",
    "dark_hex": "#6b82f5"
}
Response
{"success": true}

Tips & Warnings

Tips & Warnings
  • Get the color_id from bricks_get_color_palette first
  • Only provided fields are updated — omit fields you don’t want to change
  • Call bricks_regenerate_assets after updating to recompile CSS

Return Values

FieldTypeDescription
successbooleanWhether the color was updated successfully

Related Tools

Technical Details

Tool ID
bricks_update_color
API Endpoint
/bricks-mcp/v1/design-system/colors/{color_id}
HTTP Method
PUT
Namespace
design-system
Source File
design-system/colors.ts
Version
1.0
Min Bricks Version
1.9
Requires Auth
Yes

Changelog

v1.0
Initial release
20250101