Gradient image generator
Make an SVG image filled with a linear or radial gradient from your colour stops, plus the matching CSS.
Input
Result
Fill in the input and press Run.
Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.
Use it from code or an agent
curl -s https://setget.net/v1/tools/gradient-image \
-H 'Content-Type: application/json' \
-d '{"input":{"colours":["#2a78d6","#e87ba4"],"width":200,"height":100}}'
import json, urllib.request
body = {'input': {'colours': ['#2a78d6', '#e87ba4'], 'width': 200, 'height': 100}}
request = urllib.request.Request("https://setget.net/v1/tools/gradient-image", json.dumps(body).encode(),
{"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/gradient-image", {
method: "POST",
headers: {"Content-Type": "application/json"},
body: JSON.stringify({"input":{"colours":["#2a78d6","#e87ba4"],"width":200,"height":100}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
"slug": "gradient-image",
"input": {
"colours": [
"#2a78d6",
"#e87ba4"
],
"width": 200,
"height": 100
}
}
{
"input": {
"colours": [
"#2a78d6",
"#e87ba4"
],
"width": 200,
"height": 100
}
}
Endpoint: POST /v1/tools/gradient-image. Over MCP: run_tool with slug: "gradient-image".
Machine-readable: input schema, Markdown. Connect an agent.
Inputs
| Name | Type | Required | What it does |
|---|---|---|---|
colours |
array | yes | Two to twelve colours in order. Add a position to place a stop, such as "#ff0080 30%". |
type |
string | no | Gradient shape. One of: linear, radial. Default: "linear". |
angle |
number | no | Direction of a linear gradient in degrees, as in CSS: 0 runs bottom to top, 90 left to right. Default: 90. From -360 to 360. |
width |
integer | no | Width in pixels. Default: 800. From 1 to 4000. |
height |
integer | no | Height in pixels. Default: 400. From 1 to 4000. |
Examples
Input
{
"colours": [
"#2a78d6",
"#e87ba4"
],
"width": 200,
"height": 100
}Result
{
"svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"200\" height=\"100\" viewBox=\"0 0 200 100\"><defs><linearGradient id=\"sgfac28adc\" gradientUnits=\"userSpaceOnUse\" x1=\"0\" y1=\"50\" x2=\"200\" y2=\"50\"><stop offset=\"0%\" stop-color=\"#2a78d6\"/><stop offset=\"100%\" stop-color=\"#e87ba4\"/></linearGradient></defs><rect width=\"200\" height=\"100\" fill=\"url(#sgfac28adc)\"/></svg>",
"width": 200,
"height": 100,
"css": "linear-gradient(90deg, #2a78d6 0%, #e87ba4 100%)"
}A radial gradient with a placed stop
Input
{
"colours": [
"#fde68a",
"#f97316 40%",
"#7c2d12"
],
"type": "radial"
}Result
Different every time. Press the example button above to see one.
Questions
- How does the angle work?
- As in CSS: 0 points up, 90 points right, 180 points down. The "css" value in the result gives the same gradient for a stylesheet.
Related tools
- Background pattern generatorMake seamless SVG background patterns (dots, grid, stripes, checker or waves) with your colours and scale.
pattern-image - Placeholder image generatorMake an SVG placeholder image of any size with a centred label, for mock-ups and layouts.
placeholder-image - Social preview card generatorMake a 1200×630 social preview (Open Graph) card as SVG with a wrapped title, subtitle and site name.
og-card - .gitignore generatorBuild a .gitignore for the languages, editors and operating systems you use, merged without duplicates.
gitignore-generate - ASCII banner text generatorTurn short text into large five-line banner letters for terminals, READMEs, logs and code comments.
ascii-banner - ASCII table generatorRender headers and rows as a box-drawing or plain ASCII table for terminals, logs and code comments.
ascii-table