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

True color support #208

Closed
flying-sheep opened this issue Aug 10, 2016 · 3 comments · Fixed by #328
Closed

True color support #208

flying-sheep opened this issue Aug 10, 2016 · 3 comments · Fixed by #328
Labels
feature a feature request or enhancement

Comments

@flying-sheep
Copy link

Most terminals (except on OS X) have true color support. crayon should, too

@gaborcsardi
Copy link
Member

PRs welcome. :)

@gaborcsardi
Copy link
Member

This would be great, but probably won't happen for the next version.....

@romainfrancois
Copy link
Contributor

We could then have viridis progress bar

library(purrr)
library(glue)
library(viridis)

f <- function(){
  v100 <- as.data.frame( t(col2rgb(viridis(100))) )
  text <- glue( "\033[38;2;{r};{g};{b}m=================\033[39m\r", 
    r = v100$red, g = v100$green, b = v100$blue 
  )
  walk(text, ~{
    cat(.)
    Sys.sleep(.1)
  })
  cat("\n")
}

But rstudio does not support the 24 bits scheme so it's not that useful.

@gaborcsardi gaborcsardi transferred this issue from r-lib/crayon Dec 15, 2020
@gaborcsardi gaborcsardi added the feature a feature request or enhancement label Dec 15, 2020
gaborcsardi added a commit that referenced this issue Aug 5, 2021
* `num_ansi_colors()` now detects terminals that
  support 24 bit ANSI colors.
* `make_ansi_style()` now creates 24 bit colors for
  `#rrggbb` color specifications and color names,
  on terminals that support 24 bit colors.

Closes #208.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants