Two-Colour Gradient Generator
Pick a starting shade and a finishing shade, watch them melt into one another in a live preview, then grab the CSS so you can reuse the blend wherever you need it.
Choose Two Colours
Gradient Preview
Colour Stops
Five evenly spaced colours sampled along the gradient.
Getting a Gradient in Three Steps
Type a HEX code for the colour you want to begin with and another for the colour you want to end on, or let the Random Colours button choose for you. As you type, the preview strip redraws the blend, the code panel below fills with CSS you can paste, and a line of five equally spaced swatches shows the colours picked out along the transition.
The Maths Behind the Blend
Every stop is worked out by moving the Red, Green and Blue values of the first colour towards those of the second in a straight line. Halfway along, for example, each channel sits precisely midway between its starting and ending number, and the other positions follow the same proportion. Browsers use this very method, called linear interpolation, when they draw a CSS linear-gradient.
Gradients Beyond the Screen
A smooth blend can guide far more than a website. Use it to plan a gentle watercolour wash, a fading sky in a digital painting, or a softly lit backdrop when photographing your finished pieces. I like using a teal-to-navy blend as a backdrop plan for gold calligraphy. Pull out the sampled stops and you also have a small palette whose colours step evenly from one to the next.
Examples
Gradient Questions
What can I do with this generator?
Choose any two colours and it merges them into an even blend, displays that blend as you edit, and hands you the matching CSS.
How are the in-between colours worked out?
The Red, Green and Blue values move evenly from your first colour to your second, which means any point on the blend is a proportional mixture of the two ends.
What do the swatches under the preview show?
They are five colours taken at equal intervals across the blend, beginning with your first colour and finishing with your last, so you get a handy little palette.
How do I copy the code?
Press Copy CSS and the linear-gradient line is placed on your clipboard, ready for your stylesheet.
Is it useful if I do not build websites?
Very much so. Painters can treat the stops as a guide for an even wash, a background fade in digital art or a graduated photo backdrop, without ever opening the code.
Can I flip the direction of the blend?
You can. The Swap Colours button reverses the order of your two colours, so there is no need to type the HEX codes again.
Does it work with just a keyboard?
It does. Press Tab to move through both HEX inputs and the Swap, Random and Reset buttons, each of which responds to the keyboard.
Will it run on a phone or tablet?
Yes. The preview strip, code panel and swatches adjust their size so the tool is comfortable on small touchscreens as well as larger monitors.
Are my colours saved or uploaded?
Never. The blending runs entirely inside your own browser, so whatever you enter stays on your device and is not kept anywhere.
Do I have to pay for the generator?
No. There is no fee, nothing to install and no account to set up before you start.
Try a Blend With Real Paint
Practise smooth transitions on paper or canvas with a Creative Flair by Sana painting kit. Each one includes a well-chosen set of colours and patient, easy-to-follow steps for new painters.
Find a Painting KitThe colours shown here are digital and intended to help with planning and learning. How a colour finally looks can vary with your screen, printer, paint brand, pigment, paper and the light around you, so test any colour that matters before committing it to a finished artwork or print run.
