U device page

Can you please create a function that returns the proper color ? I don't like switch case blocks used in QML body. Thanks.