MyNixOS website logo
Description

Color Palettes Inspired by India's Natural Landscapes.

Curated color palettes drawn from India's natural beauty - Himalayan snow, Thar dunes, Kerala backwaters, Andaman reefs, Spiti's cold desert, Kashmir's autumn chinar, and more. Provides discrete and continuous palettes with first-class 'ggplot2' integration through scale_color_prakriti() and scale_fill_prakriti(), plus base graphics helpers for displaying palettes.

prakriti prakriti logo

R-CMD-check Lifecycle: experimental License: MIT

30 color palettes for R, each one pulled from an Indian landscape. Himalayan ice. Thar dunes at sunset. Flamingos over the Rann. Bioluminescent shores off Havelock. The autumn chinar canopy in Kashmir.

Palettes come in three types (sequential, diverging, qualitative) and plug straight into ggplot2 with scale_color_prakriti() and scale_fill_prakriti(). They also work fine with base graphics, lattice, or anything else that takes hex codes.

Installation

# Install from GitHub
remotes::install_github("orijitghosh/prakriti")

Quick look

library(prakriti)

# See what's available
prakriti_names()
prakriti_info()

# Pull a palette as a hex vector
prakriti_palette("thar")
#> [1] "#FFF0A3" "#FFB727" "#F57D15" "#D94701" "#8B1A04" "#3D0C02"

# Interpolate to any length
prakriti_palette("himalaya", n = 50, type = "continuous")

Display all palettes

display_prakriti()

ggplot2

Qualitative palettes default to discrete scales. Sequential and diverging palettes default to continuous. Override with discrete = TRUE/FALSE.

library(ggplot2)

# Categorical
ggplot(iris, aes(Sepal.Length, Petal.Length, color = Species)) +
  geom_point(size = 3) +
  scale_color_prakriti("valley_of_flowers")

# Continuous fill
ggplot(faithfuld, aes(waiting, eruptions, fill = density)) +
  geom_raster(interpolate = TRUE) +
  scale_fill_prakriti("himalaya")

# Diverging
cor_df <- as.data.frame(as.table(cor(mtcars)))
names(cor_df) <- c("x", "y", "r")

ggplot(cor_df, aes(x, y, fill = r)) +
  geom_tile() +
  scale_fill_prakriti("mehrangarh", limits = c(-1, 1))

The palettes

NameTypeWhat it looks like
1himalayaseqBlinding snow, glacial turquoise, bottomless sky
2tharseqBlazing dunes, saffron sunset, scorched earth
3backwatersseqLuminous palms reflected in emerald water
4western_ghatsqualOrchids, laterite, kingfishers, butterflies
5ranndivWhite salt flats, flamingo shock-pink, violet dusk
6valley_of_flowersqualEvery alpine wildflower color at once
7andamanqualElectric turquoise, fire coral, bleached sand
8nilgiriseqBlue-green mountains vanishing into mist
9spitidivIndigo night sky crashing into scorched ochre
10kazirangaqualElephant grass, rhino armor, river mud, tiger flash
11chilikaseqFlamingo clouds over pewter lagoon at first light
12mehrangarhdivJodhpur's electric blue under golden hour
13pangongseqPangong Tso shifting turquoise to ultramarine to ink
14sundarbansqualNeon mangrove, dark tidal roots, tiger-flame
15hampiseqRose-gold boulders catching sunset fire
16gulmargqualBlinding snow, vivid meadow, deodar against indigo
17loktakqualAmber dawn, floating green phumdis on deep teal
18kaasqualExplosive wildflower carpets on the plateau
19darjeelingdivKanchenjunga on fire, plunging into tea-estate green
20chinarseqGold to vermilion to smoldering embers
21gangesseqSilt gold, monsoon green, deep current
22coorgqualCoffee blossoms, red laterite, rain-soaked green
23kutch_textilequalMirrorwork silver, indigo, turmeric, madder
24jaisalmerdivSandstone fort at noon cooling into blue twilight
25munnarseqRolling tea carpets, bright flush to deep shade
26ladakh_monasteryqualPrayer-flag primaries against barren rock
27chambal_ravinesseqBone white, khaki, terracotta, deep shadow
28nocturnseqBioluminescent shores, ink sky to starlight
29konkanqualLaterite cliffs, coconut spray, Arabian Sea teal
30corbettdivGold mist, tiger-stripe amber, deep sal canopy

seq = sequential / div = diverging / qual = qualitative

API reference

FunctionWhat it does
prakriti_palette(name)Returns hex vector. Args: n, type, direction
scale_color_prakriti(name)ggplot2 color scale (also scale_colour_prakriti)
scale_fill_prakriti(name)ggplot2 fill scale
display_prakriti()Plot one or all palettes
prakriti_names()Character vector of palette names
prakriti_info()Data frame with name, type, length, inspiration

Full docs: ?prakriti_palette or see the pkgdown site.

Cookbook

The pkgdown site has full articles with rendered plots:

Contributing

Issues and PRs welcome. If you have a landscape in mind for a new palette, open an issue with reference photos and suggested hex codes.

License

MIT. See LICENSE.

Metadata

Version

0.1.4

License

Unknown

Platforms (80)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows