My aim is to display a different colour for each type of category within my array, there are over 10 categories so what I have now seems very inefficient, I have speculated using a function but have had no luck and cannot seem to find any online. my current code looks like -

```
if crime.category == "other-theft" {
                    RoundedRectangle(cornerRadius: 7.0)
                        .fill(Color.pink)
                        .frame(width: 50, height: 50)
                        .padding(.trailing)
                } else if crime.category == "possession-of-weapons" {
                    RoundedRectangle(cornerRadius: 7.0)
                        .fill(Color.red)
                        .frame(width: 50, height: 50)
                        .padding(.trailing)
                }  else if crime.category == "public-order" {
                    RoundedRectangle(cornerRadius: 7.0)
                        .fill(Color.red)
                        .frame(width: 50, height: 50)
                        .padding(.trailing)
                } else  if crime.category == "robbery" {
                    RoundedRectangle(cornerRadius: 7.0)
                        .fill(Color.cyan)
                        .frame(width: 50, height: 50)
                        .padding(.trailing)

```

Is there a smarter, less resource consuming way I can go about this?