# CSS gradient generator

> Generate a CSS linear or radial gradient from two or three colours and an angle. Preview it, then copy the CSS or the Tailwind class. Free.

Free tool by Orkosi. Page: https://orkosi.com/tools/gradient-generator

A hero background, a button, a card. Pick two colours, an optional middle one and a direction, and copy a gradient that works in every browser.

1. Type the start and the end colour, and a middle one if you like.
2. Choose linear or radial and the angle.
3. Press Generate and copy the CSS.

## Input

| Field | Type | Required | What it is |
| --- | --- | --- | --- |
| `from` | text | yes | Start colour. |
| `via` | text | no | Middle colour. Optional. |
| `to` | text | yes | End colour. |
| `type` | "linear" \| "radial" | no | Type. Default: "linear". |
| `angle` | integer | no | Angle (degrees). Default: 135. |

## Example

Input:

```json
{
  "from": "#0052FF",
  "to": "#7C3AED",
  "type": "linear",
  "angle": 135
}
```

Result:

```json
{
  "css": "background: linear-gradient(135deg, #0052FF, #7C3AED);",
  "tailwind": "bg-[linear-gradient(135deg,#0052FF,#7C3AED)]",
  "stops": "#0052FF → #7C3AED",
  "preview": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 640 240\" width=\"640\" height=\"240\" role=\"img\" aria-label=\"Gradient preview\"><defs><linearGradient id=\"g\" x1=\"0.146\" y1=\"0.146\" x2=\"0.854\" y2=\"0.854\"><stop offset=\"0%\" stop-color=\"#0052FF\"/><stop offset=\"100%\" stop-color=\"#7C3AED\"/></linearGradient></defs><rect width=\"640\" height=\"240\" fill=\"url(#g)\"/></svg>"
}
```

## Run it

It needs a free Orkosi account, nothing else. No credits are used.

- **A person**: open the page, enter an e-mail once, use the tool.
- **Claude or ChatGPT**: add the Orkosi connector `https://orkosi.com/api/v1/public/mcp` and sign in, or create the free account on the sign-in page. Then call `orkosi_run_free_tool` with `{ "tool": "gradient-generator", "input": { … } }`.
- **Any agent or program that can make an HTTP request**:

  1. Once, create the account: `POST https://orkosi.com/api/v1/public/signup` with `{ "name": "…", "email": "…", "terms_accepted": true }` and no key. Ask the person for the e-mail and their agreement to the terms first. The answer carries `data.api_key`, shown once.
  2. Run the tool:

```bash
curl -X POST https://orkosi.com/api/v1/public/tools/gradient-generator/run \
  -H "Authorization: Bearer $ORKOSI_API_KEY" -H "Content-Type: application/json" \
  -d '{"input":{"from":"#0052FF","to":"#7C3AED","type":"linear","angle":135}}'
```

The answer is `{ "data": { "tool": "…", "result": { … } } }`. A call without a key is answered 401 with the signup steps as data.

## Questions

**How do gradient angles work?**

0deg points up, 90deg to the right, 180deg down. 135deg, top-left to bottom-right, is the most used direction.

**Why does my gradient look grey in the middle?**

Two opposite colours mix to grey halfway. Add a middle colour between them, or pick neighbours on the colour wheel.

**Does it work in all browsers?**

Yes. Unprefixed linear-gradient and radial-gradient have been supported by every current browser for years.

All free tools: https://orkosi.com/tools.md
