Last active
January 8, 2018 16:57
-
-
Save Nevrage/77abd5099b19f40f0a1cac2f1898c868 to your computer and use it in GitHub Desktop.
Colorout colors from Wal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(colorout) | |
library(tidyverse) | |
library(jsonlite) | |
library(crayon) | |
library(grDevices) | |
options(prompt=blue('⇨')) | |
makeColors <- function() { | |
wal<- fromJSON("~/.cache/wal/colors.json") | |
colors <- wal$colors | |
colorize <- function (x) {paste(as.vector(col2rgb(x)), collapse = ";")} | |
colours <- lapply(colors,colorize) | |
escaped <- lapply(colours,function(x){paste("\x1b[38;2;",x,"m",sep=""}) | |
setOutputColors256(normal = 40, negnum = 209, zero = 226, | |
number = 214, date = 179, string = 85, | |
const = 35, false = 203, true = 78, | |
infinite = 39, stderror = 33, | |
warn = c(1, 0, 1), error = c(1, 15), | |
verbose = TRUE, zero.limit = NA) | |
setOutputColors256( normal=escaped[[1]], | |
number =escaped[[2]], | |
negnum =escaped[[3]], | |
date = escaped[[4]], | |
string =escaped[[5]], | |
const = escaped[[6]], | |
stderror=escaped[[7]], | |
true=escaped[[8]], | |
false= escaped[[9]]) | |
} | |
makeColors() | |
rm(makeColors) | |
cc <- function() cat(c("\033[2J","\033[0;0H")) | |
cc() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment