| Title: | Collection of Artistic and Nature-Inspired Color Palettes |
|---|---|
| Description: | Offers a variety of color palettes inspired by art, nature, and personal inspirations. Each palette is accompanied by a unique backstory, enriching the understanding and significance of the colors. |
| Authors: | Loukas Theodosiou [aut, cre] (ORCID: <https://orcid.org/0000-0001-6418-4652>) |
| Maintainer: | Loukas Theodosiou <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.4.0.9000 |
| Built: | 2026-10-29 12:21:30 UTC |
| Source: | https://github.com/loukesio/ltc-color-palettes |
Darken or lighten an entire palette or specific colors within it. Uses the colorspace package for perceptually uniform adjustments.
adjust_ltc(palette_name, amount = 0, which = NULL)adjust_ltc(palette_name, amount = 0, which = NULL)
palette_name |
Character or unquoted name. Name of the ltc palette to adjust. |
amount |
Numeric. Amount to adjust lightness (-100 to 100). Negative values darken, positive values lighten. Default is 0 (no change). |
which |
Integer vector. Which colors to adjust (e.g., c(1, 3) for 1st and 3rd). If NULL (default), adjusts all colors. |
A vector of adjusted hex color codes with class "ltc"
# Darken entire palette adjust_ltc(alger, amount = -20) # Lighten entire palette adjust_ltc("maya", amount = 30) # Darken only specific colors adjust_ltc(remains, amount = -25, which = c(2, 4))# Darken entire palette adjust_ltc(alger, amount = -20) # Lighten entire palette adjust_ltc("maya", amount = 30) # Darken only specific colors adjust_ltc(remains, amount = -25, which = c(2, 4))
Visualizes a selected colour palette in the form of a bird drawing. Requires at least 5 colors in the palette.
bird(chrom)bird(chrom)
chrom |
An ltc palette object |
A ggplot2 object showing a bird drawing using the selected colours.
# Create a bird visualization pal <- ltc(paloma) bird(pal)# Create a bird visualization pal <- ltc(paloma) bird(pal)
Apply different lightness adjustments to each color in a palette.
custom_adjust_ltc(palette_name, adjustments)custom_adjust_ltc(palette_name, adjustments)
palette_name |
Character or unquoted name. Name of the ltc palette. |
adjustments |
Numeric vector. Lightness adjustments for each color (-100 to 100). Length must match the palette length. |
A vector of adjusted hex color codes with class "ltc"
# Different adjustment for each color custom_adjust_ltc(remains, c(-30, 0, 40, 0)) # Create gradient effect custom_adjust_ltc("maya", c(-40, -20, 0, 20, 40))# Different adjustment for each color custom_adjust_ltc(remains, c(-30, 0, 40, 0)) # Create gradient effect custom_adjust_ltc("maya", c(-40, -20, 0, 20, 40))
Reduce color saturation (make colors more gray).
desaturate_ltc(palette_name, amount = 0.5, which = NULL)desaturate_ltc(palette_name, amount = 0.5, which = NULL)
palette_name |
Character or unquoted name. Name of the ltc palette. |
amount |
Numeric. Desaturation amount (0 to 1). 0 = no change, 1 = completely gray. |
which |
Integer vector. Which colors to desaturate. If NULL (default), affects all colors. |
A vector of desaturated hex color codes with class "ltc"
# Desaturate entire palette desaturate_ltc(luminaries, amount = 0.5) # Desaturate only specific colors desaturate_ltc("heatmap2", amount = 0.7, which = c(1, 2))# Desaturate entire palette desaturate_ltc(luminaries, amount = 0.5) # Desaturate only specific colors desaturate_ltc("heatmap2", amount = 0.7, which = c(1, 2))
This dataframe contains the backstory or inspiration behind each color palette.
infoinfo
An object of class data.frame with 32 rows and 2 columns.
A list containing predefined colour palettes with artistic backstories.
This function provides the desired colour palette by name. You can call it with or without quotes: ltc(paloma) or ltc("paloma")
palettes ltc(name, n, type = c("discrete", "continuous"))palettes ltc(name, n, type = c("discrete", "continuous"))
name |
Character or unquoted name. The name of the desired palette. |
n |
Integer. The number of colors you want from the palette. If omitted, it uses all colors from the palette. |
type |
The type of palette. Either "discrete" or "continuous". |
An object of class list of length 32.
ltc: A Collection of Art-inspired Colour Palettes
This package provides a collection of color palettes inspired by art, nature, and personal preferences. Each palette has a backstory, providing context and meaning to the colors.
A vector of hex color codes with class "ltc"
# Load a palette (with or without quotes) ltc(paloma) ltc("maya") # Select first 3 colors ltc(maya, n = 3) # Generate continuous palette ltc(remains, n = 10, type = "continuous")# Load a palette (with or without quotes) ltc(paloma) ltc("maya") # Select first 3 colors ltc(maya, n = 3) # Generate continuous palette ltc(remains, n = 10, type = "continuous")
Simulates how an ltc palette appears to viewers with the three
main types of colour vision deficiency (colour blindness) and shows the
result as rows of swatches. Useful for checking whether a palette stays
distinguishable for colour-blind readers.
The simulation uses colorspace: deuteranopia (green-weak, the most common), protanopia (red-weak) and tritanopia (blue-weak).
ltc_cvd(name, severity = 1, labels = TRUE)ltc_cvd(name, severity = 1, labels = TRUE)
name |
Character or unquoted palette name (e.g. |
severity |
Numeric in |
labels |
Logical. If |
A ggplot2 object: one row of swatches per vision type (Normal, Deuteranopia, Protanopia, Tritanopia).
ltc_cvd(dora) ltc_cvd("expevo", severity = 0.6)ltc_cvd(dora) ltc_cvd("expevo", severity = 0.6)
Returns a function of n that gives n colours from the named
palette, which is the form ggplot2 scales expect. Like the rest of the
package, the name may be quoted, bare, or held in a variable.
If more colours are asked for than the palette holds, the palette is interpolated to that length rather than failing, so a scale never breaks on a data set with more groups than expected.
ltc_pal(name, direction = 1)ltc_pal(name, direction = 1)
name |
Character or unquoted name. The name of the desired palette. |
direction |
1 keeps the palette order, -1 reverses it. |
A function taking n and returning a character vector of n hex
colour codes.
pal <- ltc_pal(maya) pal(3) ltc_pal("expevo", direction = -1)(5)pal <- ltc_pal(maya) pal(3) ltc_pal("expevo", direction = -1)(5)
Visualizes a selected colour palette as a bar of colours.
## S3 method for class 'ltc' plot(x, ...)## S3 method for class 'ltc' plot(x, ...)
x |
An ltc palette object |
... |
Additional arguments (currently unused). |
A ggplot2 object showing the selected colours.
# Create and plot a palette pal <- ltc(paloma) plot(pal)# Create and plot a palette pal <- ltc(paloma) plot(pal)
Custom print method that displays the palette name followed by hex color codes with actual colors visible in the console.
## S3 method for class 'ltc' print(x, ...)## S3 method for class 'ltc' print(x, ...)
x |
An ltc palette object |
... |
Additional arguments (currently unused) |
Invisibly returns the palette object
Colours the colour aesthetic with an ltc palette, the way
scale_colour_viridis() does. Set discrete = FALSE for a continuous
scale. scale_color_ltc() is the same function under the US spelling.
scale_colour_ltc(name, discrete = TRUE, direction = 1, ...) scale_color_ltc(name, discrete = TRUE, direction = 1, ...)scale_colour_ltc(name, discrete = TRUE, direction = 1, ...) scale_color_ltc(name, discrete = TRUE, direction = 1, ...)
name |
Character or unquoted name. The name of the desired palette. |
discrete |
|
direction |
1 keeps the palette order, -1 reverses it. |
... |
Passed on to |
A ggplot2 scale, to add to a plot.
library(ggplot2) ggplot(mtcars, aes(wt, mpg, colour = factor(cyl))) + geom_point(size = 3) + scale_colour_ltc(alger)library(ggplot2) ggplot(mtcars, aes(wt, mpg, colour = factor(cyl))) + geom_point(size = 3) + scale_colour_ltc(alger)
Colours the fill aesthetic with an ltc palette, the way
scale_fill_viridis() does. Set discrete = FALSE for a continuous scale.
scale_fill_ltc(name, discrete = TRUE, direction = 1, ...)scale_fill_ltc(name, discrete = TRUE, direction = 1, ...)
name |
Character or unquoted name. The name of the desired palette. |
discrete |
|
direction |
1 keeps the palette order, -1 reverses it. |
... |
Passed on to |
A ggplot2 scale, to add to a plot.
library(ggplot2) # discrete ggplot(mtcars, aes(factor(cyl), mpg, fill = factor(cyl))) + geom_boxplot() + scale_fill_ltc(maya) # continuous ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_raster() + scale_fill_ltc(heatmap0, discrete = FALSE)library(ggplot2) # discrete ggplot(mtcars, aes(factor(cyl), mpg, fill = factor(cyl))) + geom_boxplot() + scale_fill_ltc(maya) # continuous ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_raster() + scale_fill_ltc(heatmap0, discrete = FALSE)