Tailwind colors in color()
Can I use tailwind shade when using custom color()?
I would like to use yellow-50 in my component but can't work out how to use shade.
This works but only for default yellow.
Color configuration
Component
How do I add the shade?
4 Replies
I don’t think this is going to work the way you’re trying to do it. But you could technically do something like
Or more simply, if you know the hex code:
Color::rgb(‘rgb(‘. Color::Yellow[50] .’)’)
So when I set the
'pressure' => Color::Yellow,
that is an array of RGB values but then it's not possible to select which one to use when using the ->color('material')
function on an infolist? How does it know which is the default for yellow? I can manually set the RGB value similar to @wyChoong suggests but I'm just trying to understand how it works 🙂It selects the one according to the design system. So probably 700 for text