Skip to main content
Glama

cocos_derive_theme_from_seed

Generate a complete UI color palette from a single brand color for Cocos Creator projects, automatically calculating complementary colors, backgrounds, text contrast, and status indicators for consistent dark or light mode themes.

Instructions

Generate a coherent UI palette from one brand color.

Given seed_hex (the game's primary/brand color) and a mode ("dark" or "light"), computes a full color set via HSL math:

  • secondary = complementary hue

  • bg / surface = seed hue at low saturation (subtle brand tint)

  • text / text_dim = high-contrast against bg

  • border = mid-lightness neutral

  • success/warn/danger stay at fixed green/amber/red (severity readability trumps brand consistency)

Returns a {color: {...}} dict ready to pass through to cocos_set_ui_theme(project, custom=<this>). The caller may also merge in font_size / spacing / radius overrides before passing.

Typical use::

palette = cocos_derive_theme_from_seed("#6366f1", mode="dark")
cocos_set_ui_theme("/game", custom=palette)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
seed_hexYes
modeNodark
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: the tool is a generator (not destructive), uses HSL math for color computation, includes fixed colors for success/warn/danger, and returns a dict ready for another tool. However, it doesn't mention error handling, performance, or rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and front-loaded with the core purpose. It uses bullet points for algorithm details and includes a code example, but could be slightly more concise by reducing some explanatory text (e.g., 'severity readability trumps brand consistency').

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, 0% schema coverage, and no output schema, the description does an excellent job covering purpose, usage, parameters, and behavior. It explains the return format and integration with other tools. However, it lacks details on error cases or validation rules for 'seed_hex'.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It fully explains both parameters: 'seed_hex' is described as 'the game's primary/brand color', and 'mode' is explained as 'dark' or 'light' with a default of 'dark'. This adds crucial meaning beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Generate a coherent UI palette from one brand color' with specific details about the algorithm (HSL math) and output format. It distinguishes from siblings like 'cocos_set_ui_theme' by focusing on derivation rather than application.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage guidance: it includes a 'Typical use' example with code, explains when to use it (to create a palette from a seed color), and mentions integration with 'cocos_set_ui_theme'. It also implies when not to use it (e.g., for fixed themes or manual color specification).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/chenShengBiao/cocos-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server