nunomaduro / termwind

🍃 In short, it's like Tailwind CSS, but for the PHP command-line applications.
MIT License
2.29k stars 78 forks source link

Added colours utility class #18

Closed ash-jc-allen closed 3 years ago

ash-jc-allen commented 3 years ago

Hey @nunomaduro!

This package is looking really cool! 😄

This PR's only a small one. It just adds a new Color class that exposes all of the default Tailwind colours for using in the textColor and bg methods. For example, you could do something like this:

use Termwind\Utils\Color;

line('Hello')->textColor(Color::WHITE)->bg(Color::BLUE_300)->render();

I think this could be pretty useful because it could give devs a good starting point to work from, with colours that they're probably used to using from Tailwind.

Hopefully, this is something that you think would be worthwhile.

As a side note, I got the colours list from here: https://github.com/tailwindlabs/tailwindcss/blob/master/src/public/colors.js

xiCO2k commented 3 years ago

Thats an awesome addition! Thanks @ash-jc-allen

ash-jc-allen commented 3 years ago

Thanks @xiCO2k! 😄