Skip to content

A CSS value from the fields

Mix two colors by a percentage

0 keeps the first color. 100 is the second color. 50 is the midpoint of each channel.

The mix is straight RGB, not a perceptual blend.

The work stays in this tab.

This tool runs in your browser. Turn on JavaScript to use it.

Mix colors

The sample is fixed. It uses the same rule as the form.

First
#000000
Second
#ffffff
Percent
50
Result
#808080

How to use it

  1. 1Fill in the fields.
  2. 2Read the result.
  3. 3Copy the line you need.

Good to know

  • Both colors must be opaque hex, rgb(), or hsl().
  • This page does not upload the text.
  • Text longer than one hundred thousand characters is rejected.

Questions

Does the result leave this browser?

No. The calculation finishes in the current tab.

What does this page leave out?

Both colors must be opaque hex, rgb(), or hsl().

What if the input is huge?

Past one hundred thousand characters, the page stops and asks you to shorten it.

Related tools

  • Convert a color

    The same color is written as hex, RGB, or HSL depending on the file. This page parses one of those forms and prints the other two.

  • Check the contrast of two colors

    The ratio uses the WCAG relative luminance of the two opaque colors.

  • Write a linear-gradient

    The angle runs from 0 to 360 degrees. The two colors are the ends of the gradient.