Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/drmowinckels/colorhex
https://github.com/drmowinckels/colorhex
color-hex color-picker colors r rstats rstats-package
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/drmowinckels/colorhex
- Owner: drmowinckels
- License: other
- Created: 2021-01-02T21:36:23.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-09-15T23:26:22.000Z (about 1 year ago)
- Last Synced: 2023-11-20T11:22:27.703Z (about 1 year ago)
- Topics: color-hex, color-picker, colors, r, rstats, rstats-package
- Language: R
- Homepage: https://drmowinckels.github.io/colorhex/
- Size: 12.3 MB
- Stars: 17
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - drmowinckels/colorhex - (R)
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%",
fig.retina = 3
)
```# colorhex
[![CRAN status](https://www.r-pkg.org/badges/version/colorhex)](https://CRAN.R-project.org/package=colorhex)
[![R-CMD-check](https://github.com/drmowinckels/colorhex/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/drmowinckels/colorhex/actions/workflows/R-CMD-check.yaml)The goal of colorhex is to create an interface to [color-hex.com](https://www.color-hex.com/), a website with hexidecimal colors and information about them.
It also has lots of user-made palettes that can be used and browsed.
## Installation
You can install the development version from [GitHub](https://github.com/) with:
``` r
# install.packages("remotes")
remotes::install_github("drmowinckels/colorhex", ref = "main")
```
## Example### Single colors
```{r example, fig.width = 12}
library(colorhex)x <- get_color("#470f0f")
x
plot(x)
``````{r "pop-cols", , fig.width = 12, fig.height=12}
x <- get_popular_colors()
x
scales::show_col(x)
```### Palettes
```{r "latest", fig.height=10}
latest <- get_latest_palettes()
plot(latest)
``````{r "popular-palettes", fig.height=12}
popular <- get_popular_palettes()
plot(popular)
```### ggplot2 scales
```{r warning=FALSE}
library(ggplot2)ggplot(mtcars, aes(mpg)) +
geom_density(aes(fill = disp, group = disp)) +
scale_fill_palettehex_c(popular)ggplot(mtcars, aes(mpg)) +
geom_density(aes(fill = disp, group = disp)) +
scale_fill_palettehex_c(popular, 3)ggplot(mtcars, aes(mpg, disp, colour = factor(cyl))) +
geom_point() +
scale_color_palettehex_d(popular)ggplot(mtcars, aes(mpg, disp, colour = factor(cyl))) +
geom_point() +
scale_color_palettehex_d(popular, 1872)
``````{r warning=FALSE}
x <- get_color("#008080")ggplot(mtcars, aes(mpg)) +
geom_density(aes(fill = disp, group = disp)) +
scale_fill_colorhex_c(x)ggplot(mtcars, aes(mpg)) +
geom_density(aes(fill = disp, group = disp)) +
scale_fill_colorhex_c(x, "tints")ggplot(mtcars, aes(mpg)) +
geom_density(aes(fill = disp, group = disp)) +
scale_fill_colorhex_c(x, "shades")ggplot(mtcars, aes(mpg, disp, colour = factor(cyl))) +
geom_point() +
scale_color_colorhex_d(x, "triadic")ggplot(mtcars, aes(mpg, disp, colour = factor(cyl))) +
geom_point() +
scale_color_colorhex_d(x, "shades")
```