commit | 9ce317e5acf4909aa31f1d7961130da12ac021d4 | [log] [tgz] |
---|---|---|
author | Hao Zhu <haozhu233@gmail.com> | Thu Oct 12 18:19:55 2017 -0400 |
committer | Hao Zhu <haozhu233@gmail.com> | Thu Oct 12 18:19:55 2017 -0400 |
tree | dfb3a0724dd5f5bab87ecea69f366e28e1381168 | |
parent | bacd2f30398322122f88b9164003e11d27dc7eab [diff] [blame] |
Add spec_color and family
diff --git a/R/util.R b/R/util.R index 27f7d57..f80c89a 100644 --- a/R/util.R +++ b/R/util.R
@@ -110,3 +110,13 @@ "\\usepackage{threeparttable}" )) } + +latex_color <- function(color) { + if (substr(color, 1, 1) != "#") { + return(paste0("{", color, "}")) + } else { + color <- sub("#", "", color) + if (nchar(color) == 8) color <- substr(color, 1, 6) + return(paste0("[HTML]{", color, "}")) + } +}