Developer tools
CSS gradient generator (three colour stops)
Generate a linear or centred circular radial CSS gradient from three colour stops with positions from 0 to 100% and an angle for linear gradients.
The example values can be changed. Press Calculate to update the result; you can download it as TXT or CSV and collect scenarios in this tab. Nothing is saved or sent automatically.
Result
Method:
Strict hex3/4/6/8 digits. Rounded 8-bit sRGB, no print/ICC or physical pigment matching. Press Calculate to update the result; you can download it as TXT or CSV. Own formulas, no external library, font or image. Swatch reports and a separate gradient preview; codes remain in the report. Nondecreasing stops 0–100; equal stops allowed for a hard edge. Angle −360–360 checked in both modes but ignored for radial. No random input/general CSS parser. PNG/SVG swatch reports show stop colours. The separate CSS preview and gradient SVG show gradient geometry with explicit sRGB interpolation; actual CSS rendering depends on the browser. JSON and HTML contain inputs. Numeric values are original calculation values; existing report precision is retained. Optional live calculation is initially off. No automatic storage or transmission. Additional own CSS/SVG/PNG files show calculated CSS code or 240×60 result swatches over white. No embedded font or external image. Separate CSS geometry preview and 240×160 gradient SVG with own linear endpoints/centered circular radius and explicit sRGB interpolation; existing PNG/SVG reports show stop swatches. Browser colour agreement not verified.
Decimal results are approximate. Inputs stay in this browser tab.
How it works
Own bounded colour formulas: basic sRGB/HSL, alpha mixture, deterministic palettes and three-stop CSS. Own structured JSON/result-row TXT/printable HTML files retain original inputs, options and result values. Strict hex3/4/6/8 digits. Rounded 8-bit sRGB, no print/ICC or physical pigment matching. Press Calculate to update the result; you can download it as TXT or CSV. Own formulas, no external library, font or image. Swatch reports and a separate gradient preview; codes remain in the report. Nondecreasing stops 0–100; equal stops allowed for a hard edge. Angle −360–360 checked in both modes but ignored for radial. No random input/general CSS parser. PNG/SVG swatch reports show stop colours. The separate CSS preview and gradient SVG show gradient geometry with explicit sRGB interpolation; actual CSS rendering depends on the browser. JSON and HTML contain inputs. Numeric values are original calculation values; existing report precision is retained. Optional live calculation is initially off. No automatic storage or transmission. Additional own CSS/SVG/PNG files show calculated CSS code or 240×60 result swatches over white. No embedded font or external image. Separate 240×160 gradient SVG with own linear endpoints or a centred circular radius and explicit sRGB interpolation; existing PNG/SVG reports show stop swatches. Browser colour agreement not verified.
Worked example
With these example values the calculator gives the result below. You can change any value in the form above.
Inputs
- Gradient type
- Linear
- First hex colour
- #FF0000
- Middle hex colour
- #00FF00
- Last hex colour
- #0000FF
- First stop: percent
- 0
- Middle stop: percent
- 50
- Last stop: percent
- 100
- Linear angle: degrees (radial ignores it)
- 90
Result
- Generated CSS
- background: linear-gradient(90deg, #FF0000FF 0%, #00FF00FF 50%, #0000FFFF 100%);
- First colour
- #FF0000FF
- Middle colour
- #00FF00FF
- Last colour
- #0000FFFF
Frequently asked questions
Which gradient types can I create?
The CSS gradient generator creates linear or centred circular radial gradients from three entered colours and positions.
What CSS does the gradient example produce?
Red, green and blue at 0%, 50% and 100% with 90 degrees give background: linear-gradient(90deg, #FF0000FF 0%, #00FF00FF 50%, #0000FFFF 100%);
How do colour stop positions work?
Stops must be nondecreasing from 0 to 100 percent. Equal stops are allowed and create a hard edge.
Which angle can I use for a linear gradient?
The angle can be from −360 to 360 degrees; it is checked in both modes but ignored for radial gradients.
Which colour formats are accepted?
Strict hex colours with 3, 4, 6 or 8 digits. Colours are rounded 8-bit sRGB with no print or ICC matching.
Do the SVG and PNG downloads show the gradient?
The swatch SVG and PNG show only stop colours. A separate 240×160 gradient SVG shows the gradient geometry with explicit sRGB interpolation.