https://ekholme.github.io/blueycolors/
Provides bluey-inspired color palettes and ggplot2 scales
https://ekholme.github.io/blueycolors/
Last synced: 7 months ago
JSON representation
Provides bluey-inspired color palettes and ggplot2 scales
- Host: GitHub
- URL: https://ekholme.github.io/blueycolors/
- Owner: ekholme
- License: other
- Created: 2024-05-16T16:23:12.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-05-16T21:01:03.000Z (over 1 year ago)
- Last Synced: 2024-11-13T23:32:09.105Z (about 1 year ago)
- Language: R
- Homepage: https://ekholme.github.io/blueycolors/
- Size: 506 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ggplot2 - blueycolors - inspired color palettes and ggplot2 scales (Themes and aesthetics)
README
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# blueycolors
[](https://github.com/ekholme/blueycolors/actions/workflows/R-CMD-check.yaml)

blueycolors provides color palettes and ggplot2 `color` and `fill` scales inspired by [Bluey](https://www.bluey.tv/)
## Installation
You can install blueycolors from Github via:
``` r
devtools::install_github("ekholme/blueycolors")
```
## Usage
There are probably 2 main uses for this package:
1. Extracting palettes and their associated hex codes
2. Using these palettes as color or fill aesthetics in ggplot
To extract palettes & hex codes, use the `bluey_palette()` function:
```{r}
library(blueycolors)
bluey_palette("bluey")
```
To use the palettes in ggplot, use `scale_color_bluey()` and `scale_fill_bluey()` for discrete scales or `scale_color_bluey_c()` and `scale_fill_bluey_c()` for continuous scales.
```{r}
library(ggplot2)
tmp <- data.frame(
x = rnorm(100),
y = rnorm(100),
z = rep(c("a", "b", "c", "d"), 25)
)
ggplot(tmp, aes(x = x, y = y, color = z)) +
geom_point() +
scale_color_bluey()
```
```{r}
tmp2 <- data.frame(
x = 1:5,
y = c("a", "b", "c", "d", "e")
)
ggplot(tmp2, aes(x = x, y = y, fill = y)) +
geom_col() +
scale_fill_bluey(option = "socks")
```
There are currently [4 different palettes available](#palettes), but the "heeler" option probably provides the best contrast.
## Palettes
Bluey (default)
```{r}
library(scales)
show_col(bluey_palette("bluey"))
```
Chilli
```{r}
show_col(bluey_palette("chilli"))
```
Heeler
```{r}
show_col(bluey_palette("heeler"))
```
Socks
```{r}
show_col(bluey_palette("socks"))
```