->colors(): Can multiple values share the same colours?
Can
->colors()
in Filament TextColumn
accept multiple values mapping to a single colour?
Or does it only accept a single value per color? What’s the recommended way to handle multiple values that should share the same colour?
For example:
Solution:
Jump to solution
You can use that or resort to using enum (can configure color, description, labels and icons)

5 Replies
What is the use case? How can a color be multiple values at once?
Oh it's about the TextColumn. Sorry
Edited the original question, to mention this.
I think you would do something in closure like ->color(fn($record) => $record->transfer ==='out'? 'danger': 'success')
Solution
You can use that or resort to using enum (can configure color, description, labels and icons)

Thanks both 👍 👍
This turned out to be the cleanest way.