Autocolor element by certain property

Hi! Is it possible to make an element being colored depending on some property in properties panel? Would be awesome if you provide some code example/how-to