colored-rs / colored

(Rust) Coloring terminal so simple you already know how to do it !
Mozilla Public License 2.0
1.68k stars 82 forks source link

Use a macro to declare all colorized colors #83

Closed sameer closed 9 months ago

sameer commented 4 years ago

Just simplifying this a bit.

I'm also preparing to implement #48, and it looks like we need a ColorizedStr since a String cannot be created in a const fn.

mainrs commented 4 years ago

Could this be expanded to include more colors like gray for example? Not sure if I should open a new issue for this as it seems to fit great here to be honest :)

sameer commented 4 years ago

I think it would need to be a separate PR, gray is not in the color enum

mainrs commented 4 years ago

I wonder what the decision was behind the colors. I expected all ANSI colors to be in there 🤔

sameer commented 4 years ago

Actually, maybe gray is already there.

https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit

"bright black" = gray, white = light gray, and bright white = white

So then this would just be like adding a nickname for bright black (i.e. already done for magenta & purple), in which case I could add it here.

mainrs commented 4 years ago

Maybe the nicknames should be put into a separate PR. But I like the idea :)

rickygao commented 3 years ago

I like this, cuz the same idea occurred to me while checking the source. Any plans on merging?

kurtlawrence commented 9 months ago

Requiring paste dependency is not worth the gain in terseness.