Package 'peRsian'

Title: A Collection of Color Palettes Inspired by Persian Carpets.
Description: This package provides a collection of color palettes inspired by the intricate designs and rich colors of Persian carpets.
Authors: Jan Simson [aut, cre], Yeganeh Khazaei [aut]
Maintainer: Jan Simson <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2026-06-01 06:56:35 UTC
Source: https://github.com/jan-yegi/peRsian

Help Index


Enamel Microstructure Data

Description

A dataset containing measurements of enamel microstructure parameters from different enamel types, including human enamel and shark enamel, with and without fluoride treatment.

Usage

enamel

Format

A data frame with 3 rows and 5 variables:

group

Type of enamel sample (character)

ld_mean

Mean crystallite size in micrometers (numeric)

ld_sd

Standard deviation of crystallite size in micrometers (numeric)

z_mean

Mean volume percentage in vol% μm (numeric)

z_sd

Standard deviation of volume percentage in vol% μm (numeric)

Details

The dataset includes three enamel types:

  • Human enamel (untreated)

  • Shark enamel

  • Human enamel with daily rinse treatment using 0.2% NaF (sodium fluoride)

Source

Ögaard, B., Rölla, G., Ruben, J., Dijkman, T., & Arends, J. (1988). Microradiographic study of demineralization of shark enamel in a human caries model. European Journal of Oral Sciences, 96(3), 209-211. https://doi.org/10.1111/j.1600-0722.1988.tb01545.x


A Palette Generator Based on Persian Art

Description

This is a collection of color palettes based on artifacts of persian art.

Usage

persian_palette(
  name,
  n,
  direction = c(1, -1),
  selection = c("sequential", "evenly")
)

Arguments

name

Name of desired palette.

n

Number of colors desired. Empty or -1 for all colors.

direction

Sets the order of colors in the palette. If 1, the default, colors are as output in the palette. If -1, the order of colors is reversed.

selection

For discrete palettes, either "sequential" (default, selects adjacent colors) or "evenly" (maximizes distance between selected colors).

Value

A vector of colours.


Persian Color Palettes

Description

A list of color palettes inspired by Persian art and artifacts. Each palette contains a vector of hex color codes.

Usage

persian_palettes

Format

A named list of character vectors containing hex color codes

See Also

persian_palette to generate palettes and persian_palettes_colorblind_safe for colorblind-safe options.


Colorblind-Safe Persian Color Palettes

Description

A subset of Persian color palettes that are colorblind-safe. These palettes have been tested for accessibility, see vignette("check-colors").

Usage

persian_palettes_colorblind_safe

Format

A named list of character vectors containing hex color codes


Continuous Color Scale for Persian Palettes

Description

Apply a continuous Persian color palette gradient to the color aesthetic in ggplot2.

Usage

scale_color_persian_c(name, direction = 1, n = 2, selection = "evenly", ...)

scale_colour_persian_c(name, direction = 1, n = 2, selection = "evenly", ...)

Arguments

name

Name of the Persian palette to use. Options include: "munich", "fery", "tehran", "leyli", "tabriz", "hooshang", "reyhaneh", "floral", "hamburg", "pooran", "abbas", "isfahan", "berlin" See persian_palettes for all available palette names.

direction

Sets the order of colors in the scale. If -1, the order of colors is reversed.

n

Number of colors desired. Empty or -1 for all colors.

selection

For discrete palettes, either "sequential" (default, selects adjacent colors) or "evenly" (maximizes distance between selected colors).

...

Additional arguments passed to scale_color_gradientn.

Value

A ggplot2 scale object.

Examples

library(ggplot2)
ggplot(enamel, aes(x = group, y = z_mean, color = z_sd)) +
  geom_segment(aes(x = group, xend = group, y = 0, yend = z_mean), linewidth = 1) +
  geom_point(size = 5) +
  scale_color_persian_c("isfahan")

Discrete Color Scale for Persian Palettes

Description

Apply a discrete Persian color palette to the color aesthetic in ggplot2.

Usage

scale_color_persian_d(name, direction = 1, ...)

scale_color_persian(name, direction = 1, ...)

scale_colour_persian(name, direction = 1, ...)

scale_colour_persian_d(name, direction = 1, ...)

Arguments

name

Name of the Persian palette to use. Options include: "munich", "fery", "tehran", "leyli", "tabriz", "hooshang", "reyhaneh", "floral", "hamburg", "pooran", "abbas", "isfahan", "berlin" See persian_palettes for all available palette names.

direction

Sets the order of colors in the scale. If -1, the order of colors is reversed.

...

Additional arguments passed to discrete_scale.

Value

A ggplot2 scale object.

Examples

library(ggplot2)
ggplot(enamel, aes(x = group, y = ld_mean, color = group)) +
  geom_segment(aes(x = group, xend = group, y = 0, yend = ld_mean), linewidth = 1) +
  geom_point(size = 4) +
  scale_color_persian_d("isfahan")

Continuous Fill Scale for Persian Palettes

Description

Apply a continuous Persian color palette gradient to the fill aesthetic in ggplot2.

Usage

scale_fill_persian_c(name, direction = 1, n = 2, selection = "evenly", ...)

Arguments

name

Name of the Persian palette to use. Options include: "munich", "fery", "tehran", "leyli", "tabriz", "hooshang", "reyhaneh", "floral", "hamburg", "pooran", "abbas", "isfahan", "berlin" See persian_palettes for all available palette names.

direction

Sets the order of colors in the scale. If -1, the order of colors is reversed.

n

Number of colors desired. Empty or -1 for all colors.

selection

For discrete palettes, either "sequential" (default, selects adjacent colors) or "evenly" (maximizes distance between selected colors).

...

Additional arguments passed to scale_fill_gradientn.

Value

A ggplot2 scale object.

Examples

library(ggplot2)
ggplot(enamel, aes(x = group, y = ld_mean, fill = ld_sd)) +
  geom_col() +
  scale_fill_persian_c("fery")

Discrete Fill Scale for Persian Palettes

Description

Apply a discrete Persian color palette to the fill aesthetic in ggplot2.

Usage

scale_fill_persian_d(name, direction = 1, ...)

scale_fill_persian(name, direction = 1, ...)

Arguments

name

Name of the Persian palette to use. Options include: "munich", "fery", "tehran", "leyli", "tabriz", "hooshang", "reyhaneh", "floral", "hamburg", "pooran", "abbas", "isfahan", "berlin" See persian_palettes for all available palette names.

direction

Sets the order of colors in the scale. If -1, the order of colors is reversed.

...

Additional arguments passed to discrete_scale.

Value

A ggplot2 scale object.

Examples

library(ggplot2)
ggplot(enamel, aes(x = group, y = ld_mean, fill = group)) +
  geom_col() +
  scale_fill_persian_d("leyli")