Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 17 days 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 (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-15T20:50:07.000Z (over 2 years ago)
- Last Synced: 2024-06-11T23:04:54.043Z (7 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
[![R-CMD-check](https://github.com/erictleung/jwst/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/erictleung/jwst/actions/workflows/R-CMD-check.yaml)
[![Project Type Toy Badge](https://img.shields.io/badge/project%20type-toy-blue)](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")
```![](./man/figures/carina.jpg)
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")
```![](./man/figures/smacs.jpg)
```{r palette_southern_nebula_1, fig.height=2, fig.width=6}
jwst("southern_nebula_1")
```![](./man/figures/southernringnebula_1.jpg)
```{r palette_southern_nebula_2, fig.height=2, fig.width=6}
jwst("southern_nebula_2")
```![](./man/figures/southernringnebula_2.jpg)
```{r palette_stephans, fig.height=2, fig.width=6}
jwst("stephans_quintet")
```![](./man/figures/stephansquintet.jpg)
## 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.