Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: Classes for colors #686

Closed
DanChaltiel opened this issue Apr 17, 2024 · 1 comment
Closed

FR: Classes for colors #686

DanChaltiel opened this issue Apr 17, 2024 · 1 comment

Comments

@DanChaltiel
Copy link
Contributor

Hi,

I just discovered the awesome color system in cli, my console output has never been more clear and readable :-)

However, I was surprised that you have to use functions to set the colors.
I was hoping for color classes, so that the following two code lines were equivalent:

cli_bullets("This is {col_red('red')}.")
cli_bullets("This is {.red red}.")

Would that be considered?

@gaborcsardi
Copy link
Member

Thanks for the suggestion, but we are not going to do this, because it is probably better to choose the colors in a theme. Themes are somewhat hard to configure for developers, but they are much easier for end users, e.g. if you want {.emph} to be orange, you can set this in your R profile:

options(cli.user_theme = list(.emph = list(color = "orange")))

and then try:

cli::cli_text("This is {.emph orange} now")
Screenshot 2024-04-17 at 11 47 27 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants