A gradient is a CSS image that blends colors according to a selected geometry. A useful generator lets you see that geometry and copy a reproducible declaration, but it does not decide whether the result matches a brand, provides readable text contrast or works in an existing stylesheet.
This guide uses the ToolsOnDuty CSS Gradient Generator with two fixed colors. We verified linear and conic declarations, radial angle behavior and the copied CSS payload. The screenshots show the actual browser preview, not an externally designed color illustration.
Choose reproducible colors before experimenting
Open CSS Gradient Generator and set From color to #0F172A and To color to #38BDF8. The text fields and color controls let you specify the two endpoints. Keep the actual color codes rather than relying only on names such as dark blue or sky blue.
Our example uses opaque six-digit HEX colors. It is a design demonstration, not an approved brand palette or an accessibility recommendation. Start with your real design requirements and verify the destination's color representation separately if opacity, color profiles or other color spaces are involved.
Create the ninety-degree linear example
Select Linear and move Angle to 90. The tested declaration was background: linear-gradient(90deg, #0F172A, #38BDF8); and the preview blended from dark on the left toward blue on the right. In CSS's angle convention, ninety degrees points toward the right.
The preview is a fixed demonstration box, not the dimensions of your future element. A wider banner or a different layout can change the perceived transition across text or a subject. Test the gradient at the actual element size rather than assuming the generator's rectangular swatch is a complete mockup.
background: linear-gradient(90deg, #0F172A, #38BDF8);Compare conic rotation with linear direction
Select Conic and set Angle to 270. The tested output was background: conic-gradient(from 270deg, #0F172A, #38BDF8);. A conic gradient progresses around its center, rather than along the straight direction used by a linear gradient.
The angle defines the starting direction for that progression. With only two different endpoint colors, a visible seam can occur where the end of the turn meets the start. Do not mistake that for a failed conversion; inspect whether the treatment fits the intended design, and use appropriate manual CSS if you require a different stop sequence.
Understand why radial mode disables the angle
Radial mode returned radial-gradient(circle, #0F172A, #38BDF8) and disabled the angle input in our test. This current circular radial form does not use the linear or conic angle parameter. The colors spread outward according to the browser's default radial sizing.
The workspace provides two endpoints and the displayed basic geometry; it does not expose a full multi-stop editor with every CSS sizing and position option. If you need extra stops, transparency or a shifted center, review the appropriate CSS and validate the final declaration after your manual changes.
Paste the declaration deliberately into your stylesheet
Copy CSS supplied the exact displayed background declaration for the linear example. Paste a declaration inside an appropriate CSS rule, not as an unexplained value in a field that expects a color code or an entire stylesheet. Confirm what the receiving editor accepts.
The copied property is background shorthand, which can affect existing background settings beyond color alone. If you need to preserve other properties or keep a separate fallback color, choose an appropriate background-image declaration and review the resulting rule. A generated snippet is not an automatic assessment of the stylesheet it is inserted into. If the pasted rule seems ineffective, inspect computed styles for a more specific declaration or later override. Also check the color syntax instead of treating an unchanged preview as proof that a new value was accepted.
.demo-panel {
background-color: #0F172A;
background-image: linear-gradient(90deg, #0F172A, #38BDF8);
}Check text contrast and browser requirements separately
Text laid over a gradient may encounter several different background colors across its area. Readability at the dark edge does not establish readability near the lighter endpoint. Test the actual foreground and background combinations, including responsive layouts and any overlays.
This generator does not perform a WCAG contrast audit, print proof or brand review. Use the relevant checks separately, and provide a suitable fallback where your supported environment requires one. A browser accepting the CSS syntax is useful evidence of syntax, not a guarantee that every device or assistive workflow meets your requirements.
Use randomization for exploration, then save exact settings
Random gradient changes colors and angle for exploration. We checked that the resulting declaration was accepted as a background value by the test browser. Random output is not a curated palette or an assurance of aesthetically compatible or accessible colors.
Once you choose a treatment, preserve its exact declaration and test it in the real page. The tool exports CSS text rather than a downloadable PNG background. CSS can scale with the element without a new image file, but the element still needs appropriate dimensions and surrounding layout rules to display as intended.
Try the related tools
Apply the steps from this guide directly in your browser.
Frequently asked questions
What does ninety degrees mean for the linear example?
It points toward the right in CSS's angle convention, producing the tested dark-left to blue-right transition.
Why is the angle disabled in radial mode?
The current radial output is a basic circle gradient that does not use the linear or conic angle parameter.
Does Copy CSS produce a PNG image?
No. It copies a CSS background declaration. The element's layout and dimensions determine how that CSS image is displayed.
Does a generated gradient guarantee readable text contrast?
No. Test the actual foreground/background combinations and relevant accessibility requirements separately.
