Using arrays in material editor

In material blueprint, I wish to map grey color values to some predefined color values (for example, light grey to red, dark grey to green etc). Is there any way to do this? It looks like Blueprints in material editor gets compiled to shader code so I can’t use C++ functions. Also I can’t create Blueprint variables in Material editor or use arrays as far as I can see. Ideally, I would like to store 0-255 grey value mappings to some colors in an array and just index from it.