| Title: | Color Palettes Inspired by India's Natural Landscapes |
|---|---|
| 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. |
| Authors: | Arijit Ghosh [aut, cre] |
| Maintainer: | Arijit Ghosh <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.4 |
| Built: | 2026-05-20 13:56:50 UTC |
| Source: | https://github.com/cran/prakriti |
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.
display_prakriti(name = NULL, show_type = TRUE)display_prakriti(name = NULL, show_type = TRUE)
name |
Character or |
show_type |
Logical. If |
Invisibly returns NULL. Called for its side effect.
display_prakriti("rann") display_prakriti() display_prakriti(show_type = FALSE)display_prakriti("rann") display_prakriti() display_prakriti(show_type = FALSE)
Returns a data frame with one row per palette describing its name, type, length, and natural-landscape inspiration.
prakriti_info(name = NULL)prakriti_info(name = NULL)
name |
Character or |
A data frame with columns name, type, n, inspiration.
prakriti_info() prakriti_info("himalaya")prakriti_info() prakriti_info("himalaya")
Names of available prakriti palettes
prakriti_names()prakriti_names()
A character vector of palette names.
prakriti_names()prakriti_names()
prakriti paletteReturns 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().
prakriti_palette( name, n = NULL, type = c("discrete", "continuous"), direction = 1 )prakriti_palette( name, n = NULL, type = c("discrete", "continuous"), direction = 1 )
name |
Character. Name of the palette. See |
n |
Integer. Number of colors to return. If |
type |
Either |
direction |
|
A character vector of hex codes with attributes name and type.
prakriti_palette("himalaya") prakriti_palette("himalaya", n = 3) prakriti_palette("himalaya", n = 50, type = "continuous") prakriti_palette("thar", direction = -1)prakriti_palette("himalaya") prakriti_palette("himalaya", n = 3) prakriti_palette("himalaya", n = 50, type = "continuous") prakriti_palette("thar", direction = -1)
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
prakriti_palettesprakriti_palettes
A named list of length 30.
names(prakriti_palettes) prakriti_palettes$himalaya$colorsnames(prakriti_palettes) prakriti_palettes$himalaya$colors
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.
scale_color_prakriti(name, ..., discrete = NULL, direction = 1) scale_colour_prakriti(name, ..., discrete = NULL, direction = 1) scale_fill_prakriti(name, ..., discrete = NULL, direction = 1)scale_color_prakriti(name, ..., discrete = NULL, direction = 1) scale_colour_prakriti(name, ..., discrete = NULL, direction = 1) scale_fill_prakriti(name, ..., discrete = NULL, direction = 1)
name |
Character. Name of the palette. See |
... |
Additional arguments passed to the underlying ggplot2 scale
constructor ( |
discrete |
Logical or |
direction |
|
A ggplot2 scale object.
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")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")