Transform your R plots and graphics with the magical colors of Sailor Moon! 🌙✨🌸
install.packages("devtools") #If you don't already have devtools installed
devtools::install_github("morgansleeper/SailorMoonR")
#Load SailorMoonR
library(SailorMoonR)
Functions:
MoonPaletteEnumeration
: list all available palettesMoonPaletteIllumination()
: generate a sample swatch for a paletteinthenameofthemoon()
: use a palette (by having it return its color values)
# See all available palettes
MoonPaletteEnumeration
> [1] "MoonPrismPower" "MoonTiaraAction" "MoonHealingEscalation"
> [4] "MoonPrincessHalation" "ShabonSpray" "ShineAquaIllusion"
> [7] "AkuryoTaisan" "FireSoul" "SparklingWidePressure"
> [10] "JupiterOakEvolution" "VenusLoveMeChain" "CrescentBeam"
> [13] "MinatoDaylight" "MinatoSunset" "MinatoMoonlight"
> [16] "TokyoTower"
# See a sample swatch for a palette
MoonPaletteIllumination("MoonPrismPower")
# Use a palette
inthenameofthemoon("MoonPrismPower")
> [1] "#FF0083" "#0C1EB8" "#00A294" "#FFBC4D"
Prism:
If you need more colors than a given palette offers, you can generate a
larger palette by adding the prism
argument:
#Expand a palette with prism
inthenameofthemoon("CrescentBeam", prism=6)
> [1] "#862699" "#357BA9" "#00B2BD" "#00A9D8" "#56C9ED" "#D7FEFF"
MoonPaletteIllumination("MinatoSunset", prism=128)
inthenameofthemoon("MoonPrismPower")
inthenameofthemoon("MoonTiaraAction")
inthenameofthemoon("MoonHealingEscalation")
inthenameofthemoon("MoonPrincessHalation")
inthenameofthemoon("ShabonSpray")
inthenameofthemoon("ShineAquaIllusion")
inthenameofthemoon("AkuryoTaisan")
inthenameofthemoon("FireSoul")
inthenameofthemoon("SparklingWidePressure")
inthenameofthemoon("JupiterOakEvolution")
inthenameofthemoon("VenusLoveMeChain")
inthenameofthemoon("CrescentBeam")
inthenameofthemoon("MinatoDaylight")
inthenameofthemoon("MinatoSunset")
inthenameofthemoon("MinatoMoonlight")
inthenameofthemoon("TokyoTower")
library(ggplot2)
ggplot(distances, aes(x=Planet, y=Distance, fill=Planet)) +
geom_col() +
xlab("") + ylab("Distance from Sun (AU)") +
scale_fill_manual(values = inthenameofthemoon("MoonTiaraAction")) +
guides(fill=FALSE)
library(leaflet)
#Set up color palette
pal <- colorFactor(palette = (col=(inthenameofthemoon("MoonPrismPower"))), domain = locs$Type)
#Draw map
leaflet(locs) %>%
addProviderTiles(providers$CartoDB.Positron) %>%
addMarkers(label=~Name) %>%
addCircles(radius=150, weight=1, color=~pal(Type)) %>%
addLegend("topright", pal = pal, values = ~locs$Type, title = "Location type", opacity = .4) %>%
addMiniMap("bottomright", width=100, height=100, tiles = providers$CartoDB.Positron)
library(seewave)
spectro(tico, palette=colorRampPalette(inthenameofthemoon("MinatoSunset")),
collevels=seq(-50,0,1), osc=TRUE, flim=c(2,6), tlim=c(0.5,1.4), heights=c(4,2))
image(volcano, col=inthenameofthemoon("MinatoMoonlight", prism=32), axes=FALSE)
title(sub="Maungawhau", family = "sans", line=0.5, font.sub=2, cex.sub=1.2)
Project inspired by Karthik Ram’s Wes Anderson Palettes package.
Written using and pairs nicely with sailorhg’s fairyfloss theme (RStudio version available here).
Sailor Moon © Naoko Takeuchi.