Skip to main content
CalculazaEveryday calculations, made easier.

FREE ONLINE COLOR AND DESIGN TOOLS

CSS Gradient Generator

Create a CSS linear gradient from two colors.

INPUTS

Enter the details

Add the information requested below to get your result.

Your entries are used to produce the result in this browser.

How to use this tool

What does the CSS Gradient Generator do?

Create a CSS linear gradient from two colors. Enter the details above to see the result. The notes below explain the calculation method, any published formula, a worked example and important limitations.

When to use this tool

Create a CSS linear gradient from two colors. Have First color, Second color and Angle in degrees ready before you start. Preview the colour where it will actually appear, and check contrast if it sits behind text.

How to use the CSS Gradient Generator

  1. Enter the requested information: First color, Second color, Angle in degrees.
  2. Check each value, date, text entry, or unit before continuing.
  3. Tap the main button to see your result.
  4. Review the result and use Copy result when you need to reuse it.
  5. Choose Clear to remove the entries and start again.

Formula and calculation method

The colour values are interpreted or converted using the selected colour notation or colour-space relationship. You supply First color, Second color, Angle in degrees. Screens and print processes can display the same colour differently.

This tool may use a processing rule, conversion factor, validation step or generation method rather than one standalone equation. The method above describes how its output is produced.

CSS Gradient Generator worked example

Example inputs: First color: #3366cc; Second color: #ff9900; Angle in degrees: 2. Example output: background: linear-gradient(2deg, 3366cc, ff9900);

Inputs required

  • First color
  • Second color
  • Angle in degrees

Accuracy and limitations

Color calculations are based on digital color values. Real-world appearance can vary by display, brightness, color profile, and print process. Results are generated by the method built into this tool. Rounding, input format, unit selection, and assumptions can affect the output. For important decisions, verify the result independently with an appropriate trusted source.

Part of Palettes and Gradients.

Sources and further reading

These external references support the standards, concepts or browser methods related to this tool. The exact assumptions used by this calculator are described above.

Frequently asked questions

What do I need to enter?

Start with First color, Second color, Angle in degrees. Follow the field labels and keep units and formats consistent.

How is the result worked out?

The colour values are interpreted or converted using the selected colour notation or colour-space relationship. You supply First color, Second color, Angle in degrees. Screens and print processes can display the same colour differently.

What should I double-check?

Preview the colour in its intended design and check contrast wherever text needs to be readable.