Color/Colour Picker
In the color picker it stores hex or rgb values, but not tailwind colors (unless i am missing something) but textcolumn badges can only be tailwind colours. I am trying to allow the user to select a colour for statuses - how can i achieve this preferably using the built in colour picker!
Thanks ALL
9 Replies
Off the top of my head I can think of doing something like
yes but issue is that colorpicker only supports rgb, or hex - not tailwindcolors
so when creating a new status i want user to be able to choose the color
@ZedoX
I'm confused do you want to select tailwind colors or want the built-in color picker?
This idea is for displaying based on the saved hex color
there is two aspects,
1. In the admin let the user create statuses and choose a color for it
2. In a Table display the status using a badge which uses that color
I cant use a table column with a badge columnt with hex colorus @ZedoX
That's why I suggested using
->extraAttributes()
Which can be used to pass in custom classes/css styles
Oh just got what you meant! Let me try that
no sadly not
I tried TextColumn::make('status.title')->label('Status')
->searchable()
->sortable()
->badge()
->extraAttributes(function ($record) {
$color = '#666666';
return ['style' => "color:{$color}"];
}),
Ah i totally forgot v3 comes with awesome color utilities
Bloominheck never new that was even possible @awcodes and @zedox thanks so much for support!!