Swatch Palette Remap
Map source swatches to the nearest color in an approved palette using RGB channel distance and report threshold failures.
Custom requests cost 0.04 USDC on Base.
Download example JSON · OpenAPI · Source and usage
Pay with a browser wallet · Open example in checkout
POST a JSON request to /swatch-palette-remap/v1/check with an x402 V2 client.
Worked example
Request
{
"source": [
{
"id": "a",
"hex": "#0F1012"
},
{
"id": "b",
"hex": "#ffffff"
}
],
"palette": [
{
"id": "dark",
"hex": "#101010"
},
{
"id": "neutral",
"hex": "#808080"
}
],
"max_channel_distance": 10
}Result
{
"mapped": [
{
"source": "a",
"palette": "dark",
"distance": 2.24
}
],
"unmapped": [
{
"source": "b",
"nearest": "neutral",
"distance": 219.97
}
]
}Support catalog maintenance through GitHub Sponsors. Sponsor gptenv · Sponsor Jeremy Carter