Is there any elegant way to classify content in view, so that content with same value of some field gets the same value from some predefined list?
For example: I have nodes with entity reference field and would like to get different colors (from pre-defined palette) for different entities referenced through this field.
I know, that this might be solved by using Views PHP field, but this seems to be quite "hacky" to me. Also, classification lists can't be defined in user-friendly way.
Also, it's possible to add another field to referenced entity, which allows us to use this value for classification through views relationship. But this seems to overkill - and even then I would need to use something like Computed field to get randomly generated colors, which are compatible with each other (or use computed field in combination with list field - but that seems to be completely insane).
Do you know about any better solution?