Mix two colors in LAB color space

4.6k Views Asked by At

I have two colors in LAB color space, for example:

blue: 32.303, 79.197, -107.864 (hex code: #0000ff)
yellow: 97.138, -21.556, 94.482 (hex code: #ffff00)

I want to mix these two colors, and get the result color (hopefully some green in this case). Any ideas how to accomplish this?

More about LAB color space:

  1. http://www.colourphil.co.uk/lab_lch_colour_space.html
  2. http://www.broadhurst-family.co.uk/lefteye/MainPages/Lab.htm
  3. http://en.wikipedia.org/wiki/Lab_color_space
1

There are 1 best solutions below

2
On

I assume you are writing a computer implementation.

LAB is device independent. Your color codes are not, as they will be processed both by software and hardware before you see the colors. As a first approximation, convert your RGB to sRGB, which in this case will act as a reference device-independent color space.

When the sRGB values are obtained, convert to CIEXYZ and then to LAB, as the Wikipedia article on LAB suggests. Thus, write a function to compute $rgb\rightarrow sRGB \rightarrow XYZ \rightarrow L*a*b*$. Once the latter is obtained, you can interpolate linearly, e.g., take the average values of each value, and then perform the inverse transform to get your new RGB codes.