color_nearest
Map any color to the nearest Pebble GColor, and check contrast and legibility against an optional background.
Instructions
Nearest of the 64 Pebble GColors to an arbitrary color.
Args:
color: a hex string ("#RRGGBB" / "RRGGBB" / shorthand) or an
"r,g,b" triple.
background: optional background color; when given, the contrast ratio
and legibility of the matched color on it are also reported.
Returns the matched GColor name, hex, C constant, packed ARGB8 byte, sunlight-corrected display hex, and sRGB distance to the input.
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": {
"color": "<color>"
},
"name": "color_nearest"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| color | Yes | ||
| background | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||