https://github.com/erictleung/jwst
🔠R color palette inspired by the images from the JWST
https://github.com/erictleung/jwst
color-palette jwst rstats space
Last synced: 2 months ago
JSON representation
🔠R color palette inspired by the images from the JWST
- Host: GitHub
- URL: https://github.com/erictleung/jwst
- Owner: erictleung
- License: other
- Created: 2022-07-14T17:32:20.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-15T20:50:07.000Z (almost 3 years ago)
- Last Synced: 2025-02-16T07:57:02.133Z (4 months ago)
- Topics: color-palette, jwst, rstats, space
- Language: R
- Homepage:
- Size: 344 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
- Citation: CITATION.cff
Awesome Lists containing this project
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# jwst
[](https://github.com/erictleung/jwst/actions/workflows/R-CMD-check.yaml)
[](https://project-types.github.io/#toy)The goal of jwst is to be an R color palette inspired by the beautiful images
from the James Webb Space Telescope (JWST).More on the JWST itself here https://jwst.nasa.gov/index.html.
## Installation
You can install the development version of jwst like so:
```r
remotes::install_github("erictleung/jwst")
```## Example
This is a basic example which shows you how to solve a common problem:
```{r example}
library(jwst)names(jwst_palettes)
```You can call the palette in just one command.
```{r palette_carina, fig.height=2, fig.width=6}
jwst("carina")
```
If you want a specific number of colors, you can also do that.
```{r palette_carina_three, fig.height=2, fig.width=6}
jwst("carina", 3)
``````{r palette_smacs, fig.height=2, fig.width=6}
jwst("smacs")
```
```{r palette_southern_nebula_1, fig.height=2, fig.width=6}
jwst("southern_nebula_1")
```
```{r palette_southern_nebula_2, fig.height=2, fig.width=6}
jwst("southern_nebula_2")
```
```{r palette_stephans, fig.height=2, fig.width=6}
jwst("stephans_quintet")
```
## Generating your own
If you don't like the color here, you can experiment and make your own!
```{r example_generate_palette}
library(imgpalr)set.seed(1)
(x <- paste0(system.file(package = "jwst"), "/help/figures/carina.jpg"))
image_pal(
x[1],
type = "div",
saturation = c(0.75, 1),
brightness = c(0.75, 1),
plot = TRUE
)
```List other images available.
```{r}
list.files(paste0(system.file(package = "jwst"), "/help/figures"))
```See https://github.com/leonawicz/imgpalr for more.
## Acknowledgements
Code largely inspired and attributable to
https://github.com/ciannabp/inauguration.Color palettes were generated using https://github.com/leonawicz/imgpalr.
Images from NASA's James Webb Space Telescope (JWST)
https://www.nasa.gov/webbfirstimages.