{"openapi":"3.1.0","info":{"title":"SVG Recolor API","description":"\nRecolor SVG files over HTTP. Every endpoint is powered by the same engine as the website:\n[svgray](https://github.com/snailedlt/svgray) for grayscale and\n[svgshift](https://github.com/snailedlt/svgshift) for RGB/HSL color operations.\n\n**Quick start**\n\n```sh\n# Upload a file\ncurl -X POST \"https://svg-recolor.jorgenkh.no/api/recolor?color=ff0066&mode=colorize\" \\\n  -F \"file=@icon.svg\" -o icon-pink.svg\n\n# Or point at a URL; works directly in <img src=\"...\">\ncurl \"https://svg-recolor.jorgenkh.no/api/recolor?url=https://example.com/icon.svg&color=tomato\" -o icon.svg\n```\n\n**Colors** can be `ff0066`, `#ff0066` (URL-encode `#` as `%23`), `f06`, `255,0,102`,\n`rgb(255 0 102)`, `hsl(330 100% 50%)` or a CSS color name like `tomato`.\n\n**Modes**: `tint` (default), `colorize`, `hue`, `solid`, `grayscale`, `adjust`. See `GET /api/modes`.\n\n**Fine-tuning**: `hue` (-360..360 degrees), `saturation` and `lightness` (-100..100) are applied after the mode.\n\n**JSON in, JSON out**: `POST /api/recolor` also accepts `application/json` like\n`{\"svg\": \"<svg ...>\", \"color\": \"tomato\", \"mode\": \"solid\"}` (or `\"url\"` instead of `\"svg\"`).\nAdd `format=json` to get the SVG plus the old-to-new color mapping back.\n\n**AI agents**: a plain-text guide is at [`/llms.txt`](/llms.txt) and an MCP server\n(streamable HTTP) is at `/mcp`.\n","version":"2.0.0"},"paths":{"/api/health":{"get":{"tags":["Inspect"],"summary":"Check that the recolor tools work on this server","description":"Runs svgray and svgshift on one color and reports what works. Not cached.","operationId":"health","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/recolor":{"get":{"tags":["Recolor"],"summary":"Recolor an SVG from a link","description":"Fetches the SVG at `url` and returns it recolored. Responses are cacheable, so you can\nuse the endpoint directly as an image source:\n\n`<img src=\"https://svg-recolor.jorgenkh.no/api/recolor?url=https://.../icon.svg&color=tomato&mode=solid\">`","operationId":"recolorFromUrl","parameters":[{"name":"url","in":"query","required":true,"schema":{"type":"string","description":"Public http(s) link to an SVG. GitHub 'blob' links are converted to raw links.","title":"Url"},"description":"Public http(s) link to an SVG. GitHub 'blob' links are converted to raw links."},{"name":"color","in":"query","required":false,"schema":{"type":"string","description":"Target color: hex (ff0066, #ff0066, f06), RGB (255,0,102), rgb()/hsl() or a CSS name.","examples":["ff0066"],"default":"ff0066","title":"Color"},"description":"Target color: hex (ff0066, #ff0066, f06), RGB (255,0,102), rgb()/hsl() or a CSS name."},{"name":"mode","in":"query","required":false,"schema":{"enum":["tint","colorize","hue","solid","grayscale","adjust"],"type":"string","description":"How to recolor. See GET /api/modes.","default":"tint","title":"Mode"},"description":"How to recolor. See GET /api/modes."},{"name":"hue","in":"query","required":false,"schema":{"type":"integer","maximum":360,"minimum":-360,"description":"Rotate hue by this many degrees.","default":0,"title":"Hue"},"description":"Rotate hue by this many degrees."},{"name":"saturation","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":-100,"description":"Shift saturation by this many points.","default":0,"title":"Saturation"},"description":"Shift saturation by this many points."},{"name":"lightness","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":-100,"description":"Shift lightness by this many points.","default":0,"title":"Lightness"},"description":"Shift lightness by this many points."},{"name":"format","in":"query","required":false,"schema":{"enum":["svg","json"],"type":"string","description":"`svg` returns the file; `json` returns the SVG plus the color mapping.","default":"svg","title":"Format"},"description":"`svg` returns the file; `json` returns the SVG plus the color mapping."},{"name":"download","in":"query","required":false,"schema":{"type":"boolean","description":"Send as an attachment instead of inline.","default":false,"title":"Download"},"description":"Send as an attachment instead of inline."},{"name":"replace","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Give single colors their own new color, applied on top of the mode: `old:new` pairs, comma-separated. Colors in any format (hex, rgb(), names).","examples":["5e97f6:ff0000,ffffff:000000"],"title":"Replace"},"description":"Give single colors their own new color, applied on top of the mode: `old:new` pairs, comma-separated. Colors in any format (hex, rgb(), names)."},{"name":"hide","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Colors to make invisible (they become `none`/`transparent`; the shapes stay), comma-separated.","examples":["ffffff"],"title":"Hide"},"description":"Colors to make invisible (they become `none`/`transparent`; the shapes stay), comma-separated."},{"name":"remove","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Colors whose shapes are deleted, comma-separated (handy for a one-color icon: `mode=solid&remove=ffffff`). A shape whose fill or stroke alone is that color keeps the other.","examples":["ffffff"],"title":"Remove"},"description":"Colors whose shapes are deleted, comma-separated (handy for a one-color icon: `mode=solid&remove=ffffff`). A shape whose fill or stroke alone is that color keeps the other."},{"name":"cut","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Colors that become real gaps: cut through what's below them, comma-separated. The result is one path per color (Solid + cut = one path). For logos with outlines between their parts.","examples":["dce0df"],"title":"Cut"},"description":"Colors that become real gaps: cut through what's below them, comma-separated. The result is one path per color (Solid + cut = one path). For logos with outlines between their parts."},{"name":"gap","in":"query","required":false,"schema":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Cut a gap of this width wherever two original colors meet (in `unit`s). With `mode=solid` the color areas stay apart. For logos whose parts just touch.","examples":[2],"title":"Gap"},"description":"Cut a gap of this width wherever two original colors meet (in `unit`s). With `mode=solid` the color areas stay apart. For logos whose parts just touch."},{"name":"line","in":"query","required":false,"schema":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Make a line version (like devicon's line icons): only a band of this width along the edges is kept (in `unit`s).","examples":[3],"title":"Line"},"description":"Make a line version (like devicon's line icons): only a band of this width along the edges is kept (in `unit`s)."},{"name":"lines","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(all|outer)$"},{"type":"null"}],"description":"With `line`: `all` (default) also draws lines between colors, `outer` only the outline.","title":"Lines"},"description":"With `line`: `all` (default) also draws lines between colors, `outer` only the outline."},{"name":"keep","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"With `line`: colors that stay filled, comma-separated.","examples":["ffffff"],"title":"Keep"},"description":"With `line`: colors that stay filled, comma-separated."},{"name":"unit","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(px|pct)$"},{"type":"null"}],"description":"Unit of `gap` and `line`: `px` (default; the SVG's own units) or `pct` (percent of the icon's larger side).","title":"Unit"},"description":"Unit of `gap` and `line`: `px` (default; the SVG's own units) or `pct` (percent of the icon's larger side)."},{"name":"canvas","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A new canvas (viewBox) size, `WxH`. The drawing stays centered unless `place` or `fit` says otherwise.","examples":["128x128"],"title":"Canvas"},"description":"A new canvas (viewBox) size, `WxH`. The drawing stays centered unless `place` or `fit` says otherwise."},{"name":"place","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Where the drawing goes on the canvas: `x,y,scale`, where x,y is where its original top-left corner lands.","examples":["0,0,0.5"],"title":"Place"},"description":"Where the drawing goes on the canvas: `x,y,scale`, where x,y is where its original top-left corner lands."},{"name":"fit","in":"query","required":false,"schema":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Scale and center the visible drawing (strokes included) to fill the canvas, leaving this padding on every side. Devicon: `canvas=128x128&fit=1`.","examples":[1],"title":"Fit"},"description":"Scale and center the visible drawing (strokes included) to fill the canvas, leaving this padding on every side. Devicon: `canvas=128x128&fit=1`."},{"name":"optimize","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Optimize the result with SVGO 3.3.2, with the editor's default settings (multipass, every preset plugin but removeViewBox, ...; the same as devicon's).","title":"Optimize"},"description":"Optimize the result with SVGO 3.3.2, with the editor's default settings (multipass, every preset plugin but removeViewBox, ...; the same as devicon's)."},{"name":"precision","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":8,"minimum":0},{"type":"null"}],"description":"With `optimize`: decimals kept in numbers (default 3).","title":"Precision"},"description":"With `optimize`: decimals kept in numbers (default 3)."}],"responses":{"200":{"description":"Successful Response","content":{"image/svg+xml":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Recolor"],"summary":"Recolor an uploaded SVG","description":"Send the SVG in any of these ways:\n\n- multipart form: a `file` field, an `svg` field with the markup, or a `url` field\n- JSON: `{\"svg\": \"<svg ...>\", \"color\": \"tomato\", \"mode\": \"solid\"}` (or `\"url\"`)\n- raw body with `Content-Type: image/svg+xml`\n\nOptions in a form or JSON body override the query string.","operationId":"recolorSvg","parameters":[{"name":"color","in":"query","required":false,"schema":{"type":"string","description":"Target color: hex (ff0066, #ff0066, f06), RGB (255,0,102), rgb()/hsl() or a CSS name.","examples":["ff0066"],"default":"ff0066","title":"Color"},"description":"Target color: hex (ff0066, #ff0066, f06), RGB (255,0,102), rgb()/hsl() or a CSS name."},{"name":"mode","in":"query","required":false,"schema":{"enum":["tint","colorize","hue","solid","grayscale","adjust"],"type":"string","description":"How to recolor. See GET /api/modes.","default":"tint","title":"Mode"},"description":"How to recolor. See GET /api/modes."},{"name":"hue","in":"query","required":false,"schema":{"type":"integer","maximum":360,"minimum":-360,"description":"Rotate hue by this many degrees.","default":0,"title":"Hue"},"description":"Rotate hue by this many degrees."},{"name":"saturation","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":-100,"description":"Shift saturation by this many points.","default":0,"title":"Saturation"},"description":"Shift saturation by this many points."},{"name":"lightness","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":-100,"description":"Shift lightness by this many points.","default":0,"title":"Lightness"},"description":"Shift lightness by this many points."},{"name":"format","in":"query","required":false,"schema":{"enum":["svg","json"],"type":"string","description":"`svg` returns the file; `json` returns the SVG plus the color mapping.","default":"svg","title":"Format"},"description":"`svg` returns the file; `json` returns the SVG plus the color mapping."},{"name":"download","in":"query","required":false,"schema":{"type":"boolean","description":"Send as an attachment instead of inline.","default":false,"title":"Download"},"description":"Send as an attachment instead of inline."},{"name":"replace","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Give single colors their own new color, applied on top of the mode: `old:new` pairs, comma-separated. Colors in any format (hex, rgb(), names).","examples":["5e97f6:ff0000,ffffff:000000"],"title":"Replace"},"description":"Give single colors their own new color, applied on top of the mode: `old:new` pairs, comma-separated. Colors in any format (hex, rgb(), names)."},{"name":"hide","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Colors to make invisible (they become `none`/`transparent`; the shapes stay), comma-separated.","examples":["ffffff"],"title":"Hide"},"description":"Colors to make invisible (they become `none`/`transparent`; the shapes stay), comma-separated."},{"name":"remove","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Colors whose shapes are deleted, comma-separated (handy for a one-color icon: `mode=solid&remove=ffffff`). A shape whose fill or stroke alone is that color keeps the other.","examples":["ffffff"],"title":"Remove"},"description":"Colors whose shapes are deleted, comma-separated (handy for a one-color icon: `mode=solid&remove=ffffff`). A shape whose fill or stroke alone is that color keeps the other."},{"name":"cut","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Colors that become real gaps: cut through what's below them, comma-separated. The result is one path per color (Solid + cut = one path). For logos with outlines between their parts.","examples":["dce0df"],"title":"Cut"},"description":"Colors that become real gaps: cut through what's below them, comma-separated. The result is one path per color (Solid + cut = one path). For logos with outlines between their parts."},{"name":"gap","in":"query","required":false,"schema":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Cut a gap of this width wherever two original colors meet (in `unit`s). With `mode=solid` the color areas stay apart. For logos whose parts just touch.","examples":[2],"title":"Gap"},"description":"Cut a gap of this width wherever two original colors meet (in `unit`s). With `mode=solid` the color areas stay apart. For logos whose parts just touch."},{"name":"line","in":"query","required":false,"schema":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Make a line version (like devicon's line icons): only a band of this width along the edges is kept (in `unit`s).","examples":[3],"title":"Line"},"description":"Make a line version (like devicon's line icons): only a band of this width along the edges is kept (in `unit`s)."},{"name":"lines","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(all|outer)$"},{"type":"null"}],"description":"With `line`: `all` (default) also draws lines between colors, `outer` only the outline.","title":"Lines"},"description":"With `line`: `all` (default) also draws lines between colors, `outer` only the outline."},{"name":"keep","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"With `line`: colors that stay filled, comma-separated.","examples":["ffffff"],"title":"Keep"},"description":"With `line`: colors that stay filled, comma-separated."},{"name":"unit","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(px|pct)$"},{"type":"null"}],"description":"Unit of `gap` and `line`: `px` (default; the SVG's own units) or `pct` (percent of the icon's larger side).","title":"Unit"},"description":"Unit of `gap` and `line`: `px` (default; the SVG's own units) or `pct` (percent of the icon's larger side)."},{"name":"canvas","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A new canvas (viewBox) size, `WxH`. The drawing stays centered unless `place` or `fit` says otherwise.","examples":["128x128"],"title":"Canvas"},"description":"A new canvas (viewBox) size, `WxH`. The drawing stays centered unless `place` or `fit` says otherwise."},{"name":"place","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Where the drawing goes on the canvas: `x,y,scale`, where x,y is where its original top-left corner lands.","examples":["0,0,0.5"],"title":"Place"},"description":"Where the drawing goes on the canvas: `x,y,scale`, where x,y is where its original top-left corner lands."},{"name":"fit","in":"query","required":false,"schema":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Scale and center the visible drawing (strokes included) to fill the canvas, leaving this padding on every side. Devicon: `canvas=128x128&fit=1`.","examples":[1],"title":"Fit"},"description":"Scale and center the visible drawing (strokes included) to fill the canvas, leaving this padding on every side. Devicon: `canvas=128x128&fit=1`."},{"name":"optimize","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Optimize the result with SVGO 3.3.2, with the editor's default settings (multipass, every preset plugin but removeViewBox, ...; the same as devicon's).","title":"Optimize"},"description":"Optimize the result with SVGO 3.3.2, with the editor's default settings (multipass, every preset plugin but removeViewBox, ...; the same as devicon's)."},{"name":"precision","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":8,"minimum":0},{"type":"null"}],"description":"With `optimize`: decimals kept in numbers (default 3).","title":"Precision"},"description":"With `optimize`: decimals kept in numbers (default 3)."}],"responses":{"200":{"description":"Successful Response","content":{"image/svg+xml":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"svg":{"type":"string","description":"The SVG markup."},"url":{"type":"string","description":"Alternatively, a public link to an SVG."},"filename":{"type":"string","description":"Used to name the output file."},"color":{"type":"string","example":"ff0066"},"mode":{"type":"string","enum":["tint","colorize","hue","solid","grayscale","adjust"]},"hue":{"type":"integer","minimum":-360,"maximum":360},"saturation":{"type":"integer","minimum":-100,"maximum":100},"lightness":{"type":"integer","minimum":-100,"maximum":100},"format":{"type":"string","enum":["svg","json"]},"replace":{"oneOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"string"}],"description":"Per-color new colors: {\"5e97f6\": \"ff0000\"} or \"5e97f6:ff0000,...\"."},"hide":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"string"}],"description":"Colors to make invisible."},"remove":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"string"}],"description":"Colors whose shapes are deleted."},"cut":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"string"}],"description":"Colors that become real gaps (one path per color)."},"gap":{"type":"number","minimum":0,"description":"Gap width where two original colors meet."},"line":{"type":"number","minimum":0,"description":"Line version: band width along the edges."},"lines":{"type":"string","enum":["all","outer"]},"keep":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"string"}],"description":"With line: colors that stay filled."},"unit":{"type":"string","enum":["px","pct"]},"canvas":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"number"}}],"description":"New canvas (viewBox) size: \"128x128\" or [128, 128]."},"place":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"number"}}],"description":"Drawing position and scale: \"x,y,scale\" or [x, y, scale]."},"fit":{"type":"number","minimum":0,"description":"Fit the visible drawing to the canvas with this padding."},"optimize":{"type":"boolean","description":"Optimize with SVGO (default settings)."},"precision":{"type":"integer","minimum":0,"maximum":8}}},"example":{"svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 10 10\"><circle cx=\"5\" cy=\"5\" r=\"4\"/></svg>","color":"tomato","mode":"solid","format":"json"}},"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"The SVG file."},"url":{"type":"string","description":"Alternatively, a link to an SVG."}}}},"image/svg+xml":{"schema":{"type":"string"},"example":"<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 10 10\"><circle cx=\"5\" cy=\"5\" r=\"4\" fill=\"#5a9fd4\"/></svg>"}},"required":false}}},"/api/map-colors":{"get":{"tags":["Recolor"],"summary":"Recolor a list of colors","description":"Runs only the colors through the engine and returns the old-to-new mapping. The cheapest way\nto recolor: the website extracts an SVG's palette in the browser, calls this endpoint once for\nall styles (`modes=`), and applies the mapping itself. Responses are cached by the CDN, so\nidentical requests are free.\n\nAlso handy for design tokens or theme colors.","operationId":"mapColors","parameters":[{"name":"colors","in":"query","required":true,"schema":{"type":"string","description":"Comma-separated 6-digit hex colors, with or without '#'.","examples":["5a9fd4,306998,ffd43b"],"title":"Colors"},"description":"Comma-separated 6-digit hex colors, with or without '#'."},{"name":"color","in":"query","required":false,"schema":{"type":"string","description":"Target color: hex (ff0066, #ff0066, f06), RGB (255,0,102), rgb()/hsl() or a CSS name.","examples":["ff0066"],"default":"ff0066","title":"Color"},"description":"Target color: hex (ff0066, #ff0066, f06), RGB (255,0,102), rgb()/hsl() or a CSS name."},{"name":"mode","in":"query","required":false,"schema":{"enum":["tint","colorize","hue","solid","grayscale","adjust"],"type":"string","description":"How to recolor. See GET /api/modes.","default":"tint","title":"Mode"},"description":"How to recolor. See GET /api/modes."},{"name":"hue","in":"query","required":false,"schema":{"type":"integer","maximum":360,"minimum":-360,"description":"Rotate hue by this many degrees.","default":0,"title":"Hue"},"description":"Rotate hue by this many degrees."},{"name":"saturation","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":-100,"description":"Shift saturation by this many points.","default":0,"title":"Saturation"},"description":"Shift saturation by this many points."},{"name":"lightness","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":-100,"description":"Shift lightness by this many points.","default":0,"title":"Lightness"},"description":"Shift lightness by this many points."},{"name":"modes","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated modes to compute in one call; the response then has `mappings` per mode instead of `mapping`.","examples":["tint,colorize,solid"],"title":"Modes"},"description":"Comma-separated modes to compute in one call; the response then has `mappings` per mode instead of `mapping`."},{"name":"v","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Engine version; pass the `engine` value from a previous response to get a long-lived cacheable URL.","title":"V"},"description":"Engine version; pass the `engine` value from a previous response to get a long-lived cacheable URL."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Recolor"],"summary":"Recolor a list of colors (JSON)","description":"Same as `GET /api/map-colors`, for long palettes: send\n`{\"colors\": [\"#5a9fd4\", ...], \"color\": \"tomato\", \"mode\": \"colorize\"}` (or `\"modes\": [...]`).","operationId":"mapColorsPost","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/recolor/batch":{"post":{"tags":["Recolor"],"summary":"Recolor several SVGs at once","description":"Applies the same settings to every file and returns a ZIP archive.","operationId":"recolorBatch","parameters":[{"name":"color","in":"query","required":false,"schema":{"type":"string","description":"Target color: hex (ff0066, #ff0066, f06), RGB (255,0,102), rgb()/hsl() or a CSS name.","examples":["ff0066"],"default":"ff0066","title":"Color"},"description":"Target color: hex (ff0066, #ff0066, f06), RGB (255,0,102), rgb()/hsl() or a CSS name."},{"name":"mode","in":"query","required":false,"schema":{"enum":["tint","colorize","hue","solid","grayscale","adjust"],"type":"string","description":"How to recolor. See GET /api/modes.","default":"tint","title":"Mode"},"description":"How to recolor. See GET /api/modes."},{"name":"hue","in":"query","required":false,"schema":{"type":"integer","maximum":360,"minimum":-360,"description":"Rotate hue by this many degrees.","default":0,"title":"Hue"},"description":"Rotate hue by this many degrees."},{"name":"saturation","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":-100,"description":"Shift saturation by this many points.","default":0,"title":"Saturation"},"description":"Shift saturation by this many points."},{"name":"lightness","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":-100,"description":"Shift lightness by this many points.","default":0,"title":"Lightness"},"description":"Shift lightness by this many points."},{"name":"replace","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Give single colors their own new color, applied on top of the mode: `old:new` pairs, comma-separated. Colors in any format (hex, rgb(), names).","examples":["5e97f6:ff0000,ffffff:000000"],"title":"Replace"},"description":"Give single colors their own new color, applied on top of the mode: `old:new` pairs, comma-separated. Colors in any format (hex, rgb(), names)."},{"name":"hide","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Colors to make invisible (they become `none`/`transparent`; the shapes stay), comma-separated.","examples":["ffffff"],"title":"Hide"},"description":"Colors to make invisible (they become `none`/`transparent`; the shapes stay), comma-separated."},{"name":"remove","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Colors whose shapes are deleted, comma-separated (handy for a one-color icon: `mode=solid&remove=ffffff`). A shape whose fill or stroke alone is that color keeps the other.","examples":["ffffff"],"title":"Remove"},"description":"Colors whose shapes are deleted, comma-separated (handy for a one-color icon: `mode=solid&remove=ffffff`). A shape whose fill or stroke alone is that color keeps the other."},{"name":"cut","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Colors that become real gaps: cut through what's below them, comma-separated. The result is one path per color (Solid + cut = one path). For logos with outlines between their parts.","examples":["dce0df"],"title":"Cut"},"description":"Colors that become real gaps: cut through what's below them, comma-separated. The result is one path per color (Solid + cut = one path). For logos with outlines between their parts."},{"name":"gap","in":"query","required":false,"schema":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Cut a gap of this width wherever two original colors meet (in `unit`s). With `mode=solid` the color areas stay apart. For logos whose parts just touch.","examples":[2],"title":"Gap"},"description":"Cut a gap of this width wherever two original colors meet (in `unit`s). With `mode=solid` the color areas stay apart. For logos whose parts just touch."},{"name":"line","in":"query","required":false,"schema":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Make a line version (like devicon's line icons): only a band of this width along the edges is kept (in `unit`s).","examples":[3],"title":"Line"},"description":"Make a line version (like devicon's line icons): only a band of this width along the edges is kept (in `unit`s)."},{"name":"lines","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(all|outer)$"},{"type":"null"}],"description":"With `line`: `all` (default) also draws lines between colors, `outer` only the outline.","title":"Lines"},"description":"With `line`: `all` (default) also draws lines between colors, `outer` only the outline."},{"name":"keep","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"With `line`: colors that stay filled, comma-separated.","examples":["ffffff"],"title":"Keep"},"description":"With `line`: colors that stay filled, comma-separated."},{"name":"unit","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(px|pct)$"},{"type":"null"}],"description":"Unit of `gap` and `line`: `px` (default; the SVG's own units) or `pct` (percent of the icon's larger side).","title":"Unit"},"description":"Unit of `gap` and `line`: `px` (default; the SVG's own units) or `pct` (percent of the icon's larger side)."},{"name":"canvas","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A new canvas (viewBox) size, `WxH`. The drawing stays centered unless `place` or `fit` says otherwise.","examples":["128x128"],"title":"Canvas"},"description":"A new canvas (viewBox) size, `WxH`. The drawing stays centered unless `place` or `fit` says otherwise."},{"name":"place","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Where the drawing goes on the canvas: `x,y,scale`, where x,y is where its original top-left corner lands.","examples":["0,0,0.5"],"title":"Place"},"description":"Where the drawing goes on the canvas: `x,y,scale`, where x,y is where its original top-left corner lands."},{"name":"fit","in":"query","required":false,"schema":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Scale and center the visible drawing (strokes included) to fill the canvas, leaving this padding on every side. Devicon: `canvas=128x128&fit=1`.","examples":[1],"title":"Fit"},"description":"Scale and center the visible drawing (strokes included) to fill the canvas, leaving this padding on every side. Devicon: `canvas=128x128&fit=1`."},{"name":"optimize","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Optimize the result with SVGO 3.3.2, with the editor's default settings (multipass, every preset plugin but removeViewBox, ...; the same as devicon's).","title":"Optimize"},"description":"Optimize the result with SVGO 3.3.2, with the editor's default settings (multipass, every preset plugin but removeViewBox, ...; the same as devicon's)."},{"name":"precision","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":8,"minimum":0},{"type":"null"}],"description":"With `optimize`: decimals kept in numbers (default 3).","title":"Precision"},"description":"With `optimize`: decimals kept in numbers (default 3)."}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_recolorBatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/zip":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/palette":{"post":{"tags":["Inspect"],"summary":"List the colors in an uploaded SVG","description":"Returns every distinct color in the SVG (after normalizing named colors, rgb()/hsl()\nand short hex) with how often it occurs.","operationId":"listColors","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"svg":{"type":"string","description":"The SVG markup."},"url":{"type":"string","description":"Alternatively, a public link to an SVG."},"filename":{"type":"string","description":"Used to name the output file."},"color":{"type":"string","example":"ff0066"},"mode":{"type":"string","enum":["tint","colorize","hue","solid","grayscale","adjust"]},"hue":{"type":"integer","minimum":-360,"maximum":360},"saturation":{"type":"integer","minimum":-100,"maximum":100},"lightness":{"type":"integer","minimum":-100,"maximum":100},"format":{"type":"string","enum":["svg","json"]},"replace":{"oneOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"string"}],"description":"Per-color new colors: {\"5e97f6\": \"ff0000\"} or \"5e97f6:ff0000,...\"."},"hide":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"string"}],"description":"Colors to make invisible."},"remove":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"string"}],"description":"Colors whose shapes are deleted."},"cut":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"string"}],"description":"Colors that become real gaps (one path per color)."},"gap":{"type":"number","minimum":0,"description":"Gap width where two original colors meet."},"line":{"type":"number","minimum":0,"description":"Line version: band width along the edges."},"lines":{"type":"string","enum":["all","outer"]},"keep":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"string"}],"description":"With line: colors that stay filled."},"unit":{"type":"string","enum":["px","pct"]},"canvas":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"number"}}],"description":"New canvas (viewBox) size: \"128x128\" or [128, 128]."},"place":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"number"}}],"description":"Drawing position and scale: \"x,y,scale\" or [x, y, scale]."},"fit":{"type":"number","minimum":0,"description":"Fit the visible drawing to the canvas with this padding."},"optimize":{"type":"boolean","description":"Optimize with SVGO (default settings)."},"precision":{"type":"integer","minimum":0,"maximum":8}}},"example":{"svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 10 10\"><circle cx=\"5\" cy=\"5\" r=\"4\"/></svg>","color":"tomato","mode":"solid","format":"json"}},"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"The SVG file."},"url":{"type":"string","description":"Alternatively, a link to an SVG."}}}},"image/svg+xml":{"schema":{"type":"string"},"example":"<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 10 10\"><circle cx=\"5\" cy=\"5\" r=\"4\" fill=\"#5a9fd4\"/></svg>"}},"required":false}},"get":{"tags":["Inspect"],"summary":"List the colors in an SVG from a link","operationId":"listColorsFromUrl","parameters":[{"name":"url","in":"query","required":true,"schema":{"type":"string","description":"Public http(s) link to an SVG.","title":"Url"},"description":"Public http(s) link to an SVG."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/fetch":{"get":{"tags":["Inspect"],"summary":"Download an SVG from a link without changing it","description":"Used by the website to preview linked SVGs. Applies the same safety checks as\n`GET /api/recolor`.","operationId":"fetchSvg","parameters":[{"name":"url","in":"query","required":true,"schema":{"type":"string","description":"Public http(s) link to an SVG.","title":"Url"},"description":"Public http(s) link to an SVG."}],"responses":{"200":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/modes":{"get":{"tags":["Inspect"],"summary":"List the recolor modes","operationId":"listModes","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api":{"get":{"tags":["Inspect"],"summary":"List the API endpoints","description":"A machine-readable starting point: every endpoint with a one-line description.","operationId":"apiIndex","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/llms.txt":{"get":{"tags":["Inspect"],"summary":"Plain-text guide for AI agents","operationId":"llmsTxt","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/mcp":{"post":{"tags":["Inspect"],"summary":"MCP server (streamable HTTP, JSON responses)","description":"Model Context Protocol endpoint for AI agents. Stateless; send JSON-RPC 2.0 messages.\nTools: `recolor_svg`, `list_svg_colors`, `list_recolor_modes`.","operationId":"mcp","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/colorize":{"post":{"tags":["Legacy"],"summary":"Recolor an uploaded SVG (legacy)","description":"Original endpoint. Prefer `POST /api/recolor`, which takes the same `color` and\nsupports more options.","operationId":"colorizeLegacy","deprecated":true,"parameters":[{"name":"color","in":"query","required":false,"schema":{"type":"string","default":"#FF0066","title":"Color"}},{"name":"mode","in":"query","required":false,"schema":{"enum":["tint","colorize","hue","solid","grayscale","adjust"],"type":"string","description":"How to recolor. See GET /api/modes.","default":"tint","title":"Mode"},"description":"How to recolor. See GET /api/modes."}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_colorizeLegacy"}}}},"responses":{"200":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_colorizeLegacy":{"properties":{"icon":{"type":"string","contentMediaType":"application/octet-stream","title":"Icon","description":"The SVG file."}},"type":"object","required":["icon"],"title":"Body_colorizeLegacy"},"Body_recolorBatch":{"properties":{"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files","description":"Up to 50 SVG files."}},"type":"object","required":["files"],"title":"Body_recolorBatch"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"tags":[{"name":"Recolor","description":"Recolor SVGs from uploads, raw bodies or URLs."},{"name":"Inspect","description":"Look at an SVG's colors and the available modes."},{"name":"Legacy","description":"Kept for backwards compatibility."}]}