You land on a website and the hero background is exactly the gradient you have been picturing for your own page. The natural hope is that a tool can pull the colors out of that page for you. It is worth being plain about this at the start: the CSS Gradient Generator on Ovatly cannot do that. It has no eyedropper, no sampler and no import.
Recreating the gradient is still a short job. It just begins with identification instead of capture. Find the colors and the angle, then rebuild the gradient stop by stop and compare your version against the original. This guide covers both routes to the colors: reading them exactly with your browser's developer tools, or approximating them by eye.
Contents
- Quick answer
- What the generator can and cannot do
- Route one: read the exact declaration in developer tools
- Route two: approximate by eye
- How to rebuild the gradient, step by step
- Worked example: copying a 135deg blue gradient
- Limitations and honest tradeoffs
- Common mistakes
- FAQs
- Conclusion
- References
Quick answer
Open the original page in your browser, inspect the element that carries the background, and read its background declaration in the Styles panel of the developer tools: it lists the gradient type, the angle, the hex color of every stop and each stop's position. Then open the CSS Gradient Generator, set the same type and angle, enter each stop with its hex value and position, and compare the live preview against the original side by side. If you cannot read the values and have to estimate them by eye, the result is an approximation, and it is better to know that than to believe you have an exact copy.
What the generator can and cannot do
The generator builds linear, radial and conic gradients. You set the type, the angle (or, for a radial gradient, the shape), and up to six color stops, each with a hex color and a position. The preview updates with every change, stops are sorted by position in the output even if you entered them out of order, and when you are done you copy a single background declaration.
What it does not do is capture. There is no eyedropper to click on a web page, no sampler that reads a screenshot, and no field where you can paste someone else's CSS and have it parsed into stops. That limit shapes the whole workflow: the detective work happens in your browser, on the original page, before the generator is even opened.
Route one: read the exact declaration in developer tools
Every modern browser ships with developer tools, and they show you the CSS a page actually uses. Right-click on the gradient background and choose Inspect. The Styles section of the panel lists the rules applied to that element, and a CSS gradient appears there as an ordinary background declaration.
Read off four things: the type (linear, radial or conic), the angle if it is linear, the hex value of each color, and the position of each stop as a percentage. If the declaration is not on the element you inspected, it may sit on a parent element or on a pseudo-element, so walk up the document tree in the inspector until you find it. With the values in hand, the recreation is exact by construction.
Route two: approximate by eye
Sometimes the exact values are out of reach: the gradient is in a screenshot, a video, or an app you cannot inspect. Work out the hue family at each end, which end is lighter, and the direction the color travels. Build that, hold it next to the original, and adjust one stop at a time: get the end colors believable, then move the stop positions until the shift sits in the same place.
Be honest with yourself about what this route delivers. Two gradients can look like twins on your screen and still differ by several hex steps. An eyeballed match is a good resemblance, useful for inspiration; it is not a copy, and if the exact shade matters, only the read values from route one will do.
How to rebuild the gradient, step by step
- Open the CSS Gradient Generator and set the type to match the original: linear for a shift along a direction, radial for a center-out spread, conic for color sweeping around one point.
- If it is linear, set the angle to the value you read, for example 135deg: the same pair of colors at 90deg and at 135deg reads as two different gradients.
- Add the stops in order: each hex color at its position, typically the first at 0% and the last at 100%, with any middle stops at their percentages.
- If the original changes color along a hard line rather than a blend, that is two stops sharing one position. Set both stops to the same percentage to reproduce the sharp edge.
- Compare the live preview with the original, side by side. Adjust positions first, then colors, one change at a time.
- Copy the finished
backgrounddeclaration into your stylesheet.
Worked example: copying a 135deg blue gradient
Suppose the developer tools show this declaration on the original site's hero:
background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
Everything you need is in that one line: linear type, a 135deg angle, and two stops, #0ea5e9 at 0% and #2563eb at 100%. In the generator, choose linear, set the angle to 135deg, set the first stop to #0ea5e9 at 0% and the second to #2563eb at 100%. The output is the same declaration:
background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
Because every value came from the original, this is an exact recreation rather than a resemblance. Contrast that with guessing the two blues from memory: you would likely land a few steps off on at least one of them, and preview-tweaking cannot reliably close a gap you cannot measure.
Limitations and honest tradeoffs
The identification step is entirely yours. The generator cannot sample a page, read an image, or import a declaration, so a recreation is only ever as accurate as the values you bring to it.
Stops are emitted as solid hex colors. If the original gradient fades into transparency at one end, this generator cannot reproduce that fade. You can match the visible colors, but the melt into the background behind the element will not be there.
Six stops is the ceiling. An original built from eight or ten stops has to be simplified to the six that carry the transition: the two ends and the midtones where the shift visibly turns. The preview is also a live rendering inside the tool's page; the same declaration can feel slightly different at a different element size and with real content on top of it, so do the final check on your own page.
Common mistakes
- Expecting the tool to grab the colors for you. It cannot. Identification happens in the browser's developer tools, or not at all.
- Matching the colors but not the angle. The same pair at the wrong angle is a different gradient.
- Ignoring stop positions. If the original's shift happens early, with a middle stop at 30%, a plain 0% to 100% blend puts the shift in the wrong place.
- Recreating a hard edge as a blend. A sharp line in the original means two stops at one position. Spread them apart and the line dissolves.
- Judging the copy from memory. Color memory is unreliable within minutes. Always compare side by side.
FAQs
Can the generator sample colors from a website or a screenshot? No. It has no eyedropper and no sampler. You find the colors yourself and enter each one as a hex value on a stop.
How do I find the exact colors and angle a site uses? Use your browser's developer tools. Inspect the element that carries the background and read the background declaration in the Styles panel: it lists the gradient type, the angle, every hex color and each stop position.
What if the original gradient fades into transparency? Then this generator cannot reproduce it exactly. It emits stops as solid hex colors only, with no transparent stops, so a fade into transparency is outside what the tool produces.
What if the original gradient uses more than six colors? The generator supports up to six stops. Keep the stops that carry the transition: the start color, the end color and the main midtones, and drop the ones in between.
Why does my version look close but not quite identical? Usually the stop positions or the angle differ slightly, or the colors were estimated by eye. Memory and screens both drift; an exact recreation needs the original hex values and positions, not approximations of them.
Conclusion
Recreating a gradient is identification plus rebuilding: read the values honestly, rebuild them stop by stop, and compare without flattering yourself. The CSS Gradient Generator handles the rebuilding against a live preview; the reading is yours. If you are instead designing a quiet background of your own from scratch, our guide to creating a subtle background gradient for a landing page walks through that. For more guides in this series, see our Website and Webmaster Tools guides.
References
- MDN Web Docs, on the linear-gradient() function and how its angle and color stops work: https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/linear-gradient
- MDN Web Docs, on using CSS gradients, including radial and conic types: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_images/Using_CSS_gradients