All of R’s named colors in one CSS stylesheet.
For modularity, there are several stylesheets available. If you just want foreground and background colors, download r-colors.css
download.file(
"https://pkg.garrickadenbuie.com/r-colors-css/dist/r-colors.css",
"r-colors.css"
)
and then add it to your HTML R Markdown documents
output:
html_document:
css: r-colors.css
or your xaringan slides
output:
xaringan::moon_reader:
css: r-colors.css
or just about anywhere else
htmltools::includeCSS("r-colors.css")
Each of the 657 colors are available in few ways, using the color name. For example, the R color named "skyblue4"
is available
as a foreground color-setting class: .skyblue4
as a background color-setting class: .bg-skyblue4
r-colors.vars.css provides each color as a css variable: var(--skyblue4)
r-colors.hover.css provides each color as a foreground or background color-on-hover class: .skyblue4-hover
or .bg-skyblue4-hover