| Title: | Color Palettes Inspired by India's Natural Landscapes |
| Version: | 0.1.4 |
| Description: | 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. |
| License: | MIT + file LICENSE |
| Encoding: | UTF-8 |
| RoxygenNote: | 7.3.3 |
| Depends: | R (≥ 4.0) |
| Imports: | grDevices, graphics, ggplot2 (≥ 3.4.0) |
| Suggests: | testthat (≥ 3.0.0), knitr, rmarkdown, pkgdown, patchwork |
| VignetteBuilder: | knitr |
| Config/testthat/edition: | 3 |
| URL: | https://orijitghosh.github.io/prakriti/, https://github.com/orijitghosh/prakriti |
| BugReports: | https://github.com/orijitghosh/prakriti/issues |
| NeedsCompilation: | no |
| Packaged: | 2026-05-15 22:40:23 UTC; ariji |
| Author: | Arijit Ghosh [aut, cre] |
| Maintainer: | Arijit Ghosh <arijitghosh2009@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-05-20 08:40:02 UTC |
prakriti: Color palettes inspired by India's natural landscapes
Description
30 hand-tuned color palettes drawn from India's biomes and geography - Himalayan snow, Thar dunes, Kerala backwaters, Andaman reefs, Spiti's cold desert, Kashmir's autumn chinar, and more. Includes ggplot2 scales, continuous interpolation, and base-graphics display helpers.
Main functions
-
prakriti_palette()- return a vector of hex codes -
scale_color_prakriti()/scale_fill_prakriti()- ggplot2 scales -
display_prakriti()- plot palettes -
prakriti_names()/prakriti_info()- discover what's available
Author(s)
Maintainer: Arijit Ghosh arijitghosh2009@gmail.com
See Also
Useful links:
Report bugs at https://github.com/orijitghosh/prakriti/issues
Display one or all prakriti palettes
Description
Renders a base-graphics swatch view of one palette, or a stacked grid of all palettes. Useful for quick visual inspection in the R console / RStudio Plots pane.
Usage
display_prakriti(name = NULL, show_type = TRUE)
Arguments
name |
Character or |
show_type |
Logical. If |
Value
Invisibly returns NULL. Called for its side effect.
Examples
display_prakriti("rann")
display_prakriti()
display_prakriti(show_type = FALSE)
Tabular metadata for prakriti palettes
Description
Returns a data frame with one row per palette describing its name, type, length, and natural-landscape inspiration.
Usage
prakriti_info(name = NULL)
Arguments
name |
Character or |
Value
A data frame with columns name, type, n, inspiration.
Examples
prakriti_info()
prakriti_info("himalaya")
Names of available prakriti palettes
Description
Names of available prakriti palettes
Usage
prakriti_names()
Value
A character vector of palette names.
Examples
prakriti_names()
Build a color palette from a prakriti palette
Description
Returns a character vector of hex codes drawn from one of the named palettes
in prakriti_palettes. Supports both discrete subsetting and continuous
interpolation via grDevices::colorRampPalette().
Usage
prakriti_palette(
name,
n = NULL,
type = c("discrete", "continuous"),
direction = 1
)
Arguments
name |
Character. Name of the palette. See |
n |
Integer. Number of colors to return. If |
type |
Either |
direction |
|
Value
A character vector of hex codes with attributes name and type.
Examples
prakriti_palette("himalaya")
prakriti_palette("himalaya", n = 3)
prakriti_palette("himalaya", n = 50, type = "continuous")
prakriti_palette("thar", direction = -1)
Color palettes inspired by India's natural landscapes
Description
A named list of 30 palettes. Each element is itself a list with:
-
colors- character vector of hex codes -
type- one of"sequential","diverging","qualitative" -
inspiration- short prose description of the source landscape
Usage
prakriti_palettes
Format
A named list of length 30.
Examples
names(prakriti_palettes)
prakriti_palettes$himalaya$colors
ggplot2 color and fill scales for prakriti palettes
Description
These functions plug prakriti palettes into ggplot2. By default the
scale type (discrete vs. continuous) is chosen from the palette's metadata:
qualitative palettes default to discrete; sequential and diverging palettes
default to continuous. Override with discrete.
Usage
scale_color_prakriti(name, ..., discrete = NULL, direction = 1)
scale_colour_prakriti(name, ..., discrete = NULL, direction = 1)
scale_fill_prakriti(name, ..., discrete = NULL, direction = 1)
Arguments
name |
Character. Name of the palette. See |
... |
Additional arguments passed to the underlying ggplot2 scale
constructor ( |
discrete |
Logical or |
direction |
|
Value
A ggplot2 scale object.
Examples
library(ggplot2)
ggplot(mtcars, aes(wt, mpg, color = factor(cyl))) +
geom_point(size = 3) +
scale_color_prakriti("valley_of_flowers")
ggplot(faithfuld, aes(waiting, eruptions, fill = density)) +
geom_raster() +
scale_fill_prakriti("himalaya")