Title: Colour Palettes Inspired by Butterflies
Version: 0.1.0
Description: A collection of colour palettes inspired by some of our dearest butterfly species. This package provides continuous and categorical palettes, including some colour blind friendly options.
License: GPL (≥ 3)
Encoding: UTF-8
RoxygenNote: 7.3.2
Suggests: knitr, rmarkdown
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2025-05-15 10:12:50 UTC; saragamboa
Author: Sara Gamboa ORCID iD [aut, cre], Adrián Castro Insua ORCID iD [aut], Sofía Galván ORCID iD [aut], Graciela Sotelo ORCID iD [aut], Marta Matamala-Pagès ORCID iD [aut], Adriana Oliver ORCID iD [aut], Iván Rey-Rodríguez ORCID iD [aut], Eduardo Méndez-Quintas ORCID iD [aut], Sara Varela ORCID iD [aut]
Maintainer: Sara Gamboa <sara.gamboa@uvigo.gal>
Repository: CRAN
Date/Publication: 2025-05-19 13:30:02 UTC

Colour palettes inspired by butterflies

Description

Returns a colour palette from the lepidochroma collection.

Usage

lepidochroma(name, n = NULL)

Arguments

name

Palette name (see the name column in the data frame returned by lepidochroma_palettes() for a list of available options). This argument is case insensitive.

n

Number of colours to return. It is an optional argument: if it is not specified, all available colours for the specified palette will be returned. For continuous palettes (see the output of lepidochroma_palettes()) this parameter can take any number >= 2. For discrete palettes, its maximum value is limited to their number of colours.

Value

A character vector with colours as hexadecimal strings.

Examples

# Discrete palette
lepidochroma("attacus", 4)
# Continuous palette
lepidochroma("morpho", 30)


Palette preview

Description

Displays a preview of a palette or a set of palettes with the specified number of colours in a plot.

Usage

lepidochroma_display(
  name = NULL,
  n = NULL,
  type = c("all", "discrete", "continuous"),
  colourblind_only = FALSE
)

Arguments

name

Palette name (see the name column in the data frame returned by lepidochroma_palettes() for a list of available options). This argument is case insensitive. If it is not specified, all palettes matching the properties indicated in the type and colourblind_only arguments will be displayed.

n

Number of colours to display. It is an optional argument, if it is not specified, the plot will display all the available colours.

type

The type of palettes to be displayed ("all", "discrete", or "continuous"). This argument is ignored if name is specified. It defaults to "all".

colourblind_only

A logical value. If TRUE, display only colour blind friendly palettes. This argument is ignored if name is specified. It defaults to FALSE.

Value

No return value, called for side effects.

Examples

# Discrete palette
lepidochroma_display("parthenos", 3)
# Continuous palette
lepidochroma_display("battus", 30)


Get information on available palettes

Description

Returns a data frame with the names and information on the palettes that are available in the package.

Usage

lepidochroma_palettes()

Value

A data frame with 3 variables:

Examples

lepidochroma_palettes()