make all grayscale but some colors

Hi everyone,

I have a question… If it’s possible to make something like
having the whole scene grayscale, but keep some colors.

Not like red or green or blue only… but something like yellow and brown, for example.

Is that possible? How would be the best way to achieve this.

I was thinking about having multiple layers and making some of them enabled programmatically, but I am not sure if it’s possible and if it would be the best solution.

Any ideas?

Keeping R,G,B is trivial using the built-in color curves image effect. http://docs.unity3d.com/Manual/script-ColorCorrectionCurves.html

Keeping “yellow” or “brown” is harder, because:

  1. The definition of these colours is somewhat arbitrary, and
  2. It depends on testing the value of more than one channel

There’s a couple of different approaches you could take, but the simplest is probably to make a custom LUT applies to the color correction effect: http://docs.unity3d.com/Manual/script-ColorCorrectionLookup.html