Free Online Color Gradient Generator
Create beautiful linear or radial CSS gradients with customizable colors and directions. Preview your gradient live and copy the CSS code for your projects.
background: linear-gradient(to right, #10B981, #3B82F6);
About This Gradient Generator
I’ve spent years designing websites and apps, and gradients are my secret weapon for adding depth and flair. This tool was born out of my need to quickly create and test CSS gradients without fiddling in code editors. It lets you pick colors, choose linear or radial gradients, and set directions, then generates clean CSS code you can copy instantly. Whether you’re styling buttons, backgrounds, or overlays, this tool makes gradients accessible and fun for designers and developers alike.
How to Use the Gradient Generator
Here’s my workflow for creating gradients that elevate designs:
- Select Gradient Type: Choose linear for directional gradients or radial for circular effects. I use linear for sleek backgrounds and radial for focal points.
- Pick Colors: Use the color pickers or enter HEX codes (e.g., #10B981, #3B82F6). I often start with brand colors for consistency.
- Set Direction: Pick a direction like “to right” or “45deg” for linear, or “circle at center” for radial. I test a few to see what fits the design vibe.
- Generate and Copy: Click “Generate Gradient” to see the preview, then copy the CSS code with the “Copy CSS” button. I paste it directly into my CSS or Figma prototypes.
Usage Examples from My Projects
Here’s how I’ve used this tool to bring designs to life:
- Hero Section Background: I created a linear gradient from teal (#14B8A6) to navy (#1E3A8A) at 45deg for a modern website hero, adding depth and sophistication.
- App Button Glow: For a mobile app, I used a radial gradient from yellow (#FBBF24) to orange (#F97316) with “circle at center” to make buttons pop.
- Card Hover Effect: I designed a linear gradient from purple (#8B5CF6) to pink (#EC4899) to “to right” for a card hover state, creating a dynamic UI.
- Presentation Slide: For a client pitch, I used a radial gradient from white (#FFFFFF) to light blue (#BFDBFE) to give slides a clean, professional backdrop.
Frequently Asked Questions
When should I use linear vs. radial gradients?
In my designs, I use linear gradients for directional flows, like website headers or button backgrounds, to guide the eye (e.g., left-to-right transitions). Radial gradients are great for focal points, like a glowing button or a centered background effect in an app. Try both and preview to see what suits your project’s mood!
Can I use these gradients in non-web projects?
Yes, I’ve done it! The CSS code works for web, but I’ve also used these gradients in design tools like Figma or Adobe XD for apps and print mockups. For print, I convert the HEX colors to CMYK and test a proof, as gradients can look different on paper.
How do I ensure my gradient is accessible?
I learned this the hard way: gradients can make text hard to read. If using a gradient as a background, I pair it with text that has a high contrast ratio (check with our Contrast Checker tool). For example, white text on a dark gradient needs at least a 4.5:1 ratio for WCAG AA compliance.
Why does my gradient look different on another device?
I’ve run into this issue before. Gradients can vary due to screen calibration or color profiles (sRGB vs. Adobe RGB). I stick to sRGB for web gradients, which this tool uses, and test on multiple devices. Including an sRGB profile in your CSS or design files helps keep colors consistent.
Can I add more than two color stops?
This version supports two color stops for simplicity, which covers most of my design needs. For complex gradients, I add stops manually in the CSS code after copying. We’re considering adding multi-stop support—let us know if you want it prioritized!
Gradient Types Reference
Type | Description | Best For |
---|---|---|
Linear | Colors transition in a straight line along a specified direction (e.g., to right, 45deg). | Website headers, button backgrounds, or UI elements needing directional flow. |
Radial | Colors radiate from a central point, in a circle or ellipse shape. | Focal points like glowing buttons, centered backgrounds, or app splash screens. |