Closed bigperson closed 5 years ago
You aren't able to do this in the way you have described yet, but I might look at it if I get time. I'd be happy to review a pull request too.
What you could do for now is serve your own CSS file (using Nova's Asset functionality) and add your own classes with the background colours defined.
The classes must be named e.g. indicator-*yourcolourname*
so your CSS would be:
.indicator-yourcolourname {
background: #000000;
}
and your Field definition would be:
Indicator::make('Status')
->colors([
'yourstatus' => 'yourcolourname',
])
Wouldn't this be pretty easy to implement just by using a regex to check for #
followed by 3 or 6 alphanumerical characters?
This would make this package synergize very nicely with https://novapackages.com/packages/timothyasp/nova-color-field
I am implementing this now. If the colour string starts with # it will be interpreted as a background-color, otherwise as a class.
How to i can add custom colors?