How to color surfaces of Shape objects according to categorical values?

I’m using fill_z to color surfaces inside Shape() objects. I have a column that has categorical data. But fill_z only accepts type float. I mean I can have an additional column with float values, but if I for example only have two cases, using 1.0 and 2.0, it doesn’t color the two different cases accordingly. Does anyone have a solution to this dilemma?