Changing colours precisely, procedurally
Yes, FAC is driven by luminance (from 0.0 to 1.0), and yes, two different colors can have the same luminance.
The task isn't impossible, but you would end up with a very complicated node tree, which will have to recognise each of the 18 colors and send them to 18 color nodes or a color ramp.
I think it would be simpler to use an image editor software to create a copy of the texture with 18 different shades of grey, and use this new texture to drive a color ramp.