toolqik

188 · CSS

CSS Gradient Generator

Design linear, radial and conic gradients visually with draggable colour stops.

Runs in your browser
Type
Shape
Options
    CSS
    
      

    About this tool

    Build a CSS gradient by eye: pick the type, drag the colour stops along the bar, change colours and positions, and copy the CSS. Click the bar to add a stop. Start from a preset if you want inspiration.

    The three gradient types

    • Linear: colours change along a straight line at an angle. 0deg points up, 90deg to the right.
    • Radial: colours spread out from a centre point as a circle or ellipse.
    • Conic: colours sweep around a centre point, like a colour wheel or pie chart. With hard stops, it draws pie charts without any images.

    Smoother gradients with OKLab and OKLCH

    Gradients between two saturated colours often pass through a dull, greyish middle, because browsers blend in sRGB by default. Modern CSS lets you choose the blending space: linear-gradient(in oklab, …) gives an even, natural blend, and in oklch keeps colours vivid by travelling around the hue wheel. They’re supported in all current browsers; the generator adds a plain sRGB fallback line for older ones.

    Tips

    • Two stops at the same position make a hard edge, useful for stripes and pie charts.
    • Turn on Repeating with stops that end before 100% to create stripes.
    • Gradients are images, so use background or background-image, not background-color.
    • Check text contrast over every part of a gradient, not just the middle, with the Color Converter.

    FAQ

    How do I make a gradient in CSS?

    Use background: linear-gradient(135deg, #color1, #color2). Add more colour stops, change the angle, or use radial-gradient or conic-gradient for other shapes.

    How do I add a colour stop?

    Click anywhere on the gradient bar, or press + Stop. Drag a stop’s handle to move it, and use × in the list to remove it.

    What does “in oklch” mean?

    It sets the colour space the browser blends in. OKLab and OKLCH avoid the muddy middle you get between some colours in sRGB.

    How do I make stripes?

    Turn on Repeating and use pairs of stops at the same position, for example red 0 10px, white 10px 20px.

    Can I animate a gradient?

    Not its colours directly in older browsers. Animate background-position on a larger gradient, or register custom properties with @property and animate those.

    esc
    ↑↓ navigate↵ open