Select specific color without If?

Made a Ceil Gradient and unless I can find a way to shift it I need to depict a specific grey to use in a Lerp? At the moment can only figure using an If but want to be able to change how many tiles there should be.

The desired end result is making each grey a different color.

This has become slightly unrelated but I’m using a different way. Instead of depending on the grey scale I’ve ended up with a shiftable grid, so all is needed is to specify a grid length and select row/column …

Still not sure this is the best way to do it, or which one is quicker? I’ve added it to a function but it does mean calling is for each tile.