Skip to main content
Glama

generate_ramp

Generate a dark-to-light shading ramp from a base color for pixel art, adjust hue and saturation across steps, and optionally append or replace it in an Aseprite sprite palette.

Instructions

Generate a shading ramp from a base colour (dark -> light).

Produces `steps` colours by varying lightness across `light_range`, optionally
rotating hue by `hue_shift` total degrees across the ramp (classic pixel-art
hue shifting: cool shadows / warm highlights) and scaling saturation by
`saturation_shift` percent across the ramp.

Args:
    filename: If set with apply, write the ramp into that sprite's palette.
    apply: "none" (just return), "append" (add to palette), or "replace".
    chroma: The saturation the ramp holds, 0 to 1, in place of the base colour's own.
        **HLS saturation**, which is what `colorsys.rgb_to_hls` reports and not the
        HSV saturation an eyedropper usually shows. The two part company at the light
        end: #ff8080 is 1.00 saturated in HLS and 0.50 in HSV, so a caller passing a
        number read off a colour picker will get a more colourful ramp than intended.

Returns the ramp as a list of "#RRGGBB" colours (darkest first), with `distinct`, how
many of them are different from each other, and `hue_span`, `sat_floor` and
`grey_steps` measuring whether the hue rotation can actually be seen.

**`chroma` is usually the argument that matters, and it is easy to miss.** Every hue
control here rotates hue; none of them creates saturation, which is inherited from
`base_color` and only scaled from there. So a base picked for its *value*, the way a
base is usually picked ("stone is grey", so `#8a7f74`), carries almost no saturation,
and the ramp built from it rotates a hue that cannot be seen: the ramp this argument
was added for turned 143 degrees of hue at a 0.08 saturation floor and rendered as
eight greys, which is what `grey_steps` now says out loud. Reference work in this
style runs its apparent greys at 0.17 to 0.30. Setting `chroma` is how a ramp gets
that without the caller having to reverse-engineer a saturated base colour they did
not want to name.

**`distinct` is not always `steps`.** Lightness is clamped at both ends, so a base
already near white or near black spends its outermost steps on the same colour: nine
steps in, eight colours out. The ramp is still returned, because clamping is the honest
result of the inputs and a caller may not care, but `warnings` then names which end
collapsed and the nearest `light_range` that would not.

It is worth caring about at least once. `specular_highlight` needs the ramp's top step
to be brighter than what `shade_region_by_light` spread across the lit side, so a ramp
whose top two entries are both `#ffffff` makes that call refuse, with a message about
the shading pass. The cause is two calls earlier, in this one, which used to report
success either way.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "base_color": "<base_color>"
    },
    "name": "generate_ramp"
  }
}

Input Schema

NameRequiredDescriptionDefault
applyNoDefault: "none".none
stepsNoDefault: 5.
chromaNo
easingNoDefault: "linear".linear
filenameNo
hue_shiftNoDefault: 0.0.
light_hueNo
sat_curveNoDefault: "linear".linear
base_colorYes
shadow_hueNo
light_rangeNoDefault: 0.6.
saturation_shiftNoDefault: 0.0.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.11.0
    • addedInput schema / properties / chroma
      Added value: +{
      +  "type": "number"
      +}
  2. Changed20 schema fields changedv0.10.0
    • addedInput schema / properties / apply / description
      Added value: +"Default: \"none\"."
    • removedInput schema / properties / apply / title
      Removed value: -"Apply"
    • removedInput schema / properties / base_color / title
      Removed value: -"Base Color"
    • addedInput schema / properties / easing
      Added value: +{
      +  "default": "linear",
      +  "description": "Default: \"linear\".",
      +  "type": "string"
      +}
    • removedInput schema / properties / filename / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / filename / default
      Removed value: -null
    • removedInput schema / properties / filename / title
      Removed value: -"Filename"
    • addedInput schema / properties / filename / type
      Added value: +"string"
    • addedInput schema / properties / hue_shift / description
      Added value: +"Default: 0.0."
    • removedInput schema / properties / hue_shift / title
      Removed value: -"Hue Shift"
    • addedInput schema / properties / light_hue
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / light_range / description
      Added value: +"Default: 0.6."
    • removedInput schema / properties / light_range / title
      Removed value: -"Light Range"
    • addedInput schema / properties / sat_curve
      Added value: +{
      +  "default": "linear",
      +  "description": "Default: \"linear\".",
      +  "type": "string"
      +}
    • addedInput schema / properties / saturation_shift / description
      Added value: +"Default: 0.0."
    • removedInput schema / properties / saturation_shift / title
      Removed value: -"Saturation Shift"
    • addedInput schema / properties / shadow_hue
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / steps / description
      Added value: +"Default: 5."
    • removedInput schema / properties / steps / title
      Removed value: -"Steps"
    • removedInput schema / title
      Removed value: -"generate_rampArguments"
  3. First observedv0.7.0

TDQS

A4.1/5.0
Behavior5/5

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

Annotations mark it non-read-only and closed-world, and the description explains the mutation path via apply (append/replace writes into a sprite palette). It also discloses return fields, lightness clamping, warnings, distinct vs steps behavior, HLS-vs-HSV saturation pitfalls, and a downstream specular_highlight failure mode, adding substantial behavior beyond the annotations.

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

Conciseness3/5

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

The operation is front-loaded and the Args/Returns structure helps scanning, but the prose is long and narrative, with editorial asides such as 'It is worth caring about at least once' and 'which is what grey_steps now says out loud'. Much of the content is useful, but tighter wording would improve scanability.

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?

For a 12-parameter tool with no output schema, it covers the core inputs, apply side effects, return fields, and failure modes well. It is still incomplete for easing, sat_curve, light_hue, and shadow_hue, so an agent cannot fully reason about those controls without opening the schema and guessing.

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

Parameters4/5

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

The description adds real meaning beyond schema defaults for steps, light_range, hue_shift, saturation_shift, apply/filename side effects, and especially chroma's HLS saturation semantics. However, easing, sat_curve, light_hue, and shadow_hue are left undefined, so four of twelve parameters remain undocumented at 58% schema coverage.

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

Purpose4/5

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

Opens with a specific verb and resource ('Generate a shading ramp from a base colour') and states the output direction (dark -> light), so the core operation is unmistakable. It does not directly route against sibling ramp generators such as ramp_between or ramp_from_art; the sibling mentions are about shading/specular interactions rather than alternatives.

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

Usage Guidelines4/5

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

It defines the apply modes (none/append/replace), identifies chroma as 'usually the argument that matters', and explains when to care about distinct versus steps and downstream specular failures. It does not explicitly say when to choose this tool over other ramp-generation siblings, so it is context-rich but not full alternative routing.

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

Deploy Server

Other Tools