Type: Package
Title: A Vincent Van Gogh Color Palette Generator
Version: 0.1.1
Maintainer: Cheryl Isabella <cheryl.academic@gmail.com>
Description: Palettes generated from Vincent van Gogh's paintings.
License: MIT + file LICENSE
Depends: R (≥ 3.0)
Encoding: UTF-8
Imports: ggplot2
Suggests: knitr, rmarkdown, scales, testthat (≥ 3.0.0)
URL: https://github.com/cherylisabella/vangogh
RoxygenNote: 7.1.2
VignetteBuilder: knitr
Config/testthat/edition: 3
NeedsCompilation: no
Packaged: 2022-05-26 14:32:06 UTC; Isabella
Author: Cheryl Isabella [aut, cre]
Repository: CRAN
Date/Publication: 2022-05-27 08:00:02 UTC

Setup colour palette for ggplot2

Description

Setup colour palette for ggplot2

Usage

scale_color_vangogh(
  ...,
  palette = "StarryNight",
  discrete = TRUE,
  alpha = 1,
  reverse = FALSE
)

scale_colour_vangogh(
  ...,
  palette = "StarryNight",
  discrete = TRUE,
  alpha = 1,
  reverse = FALSE
)

Arguments

...

additional arguments to pass to scale_color_gradientn

palette

Choose from 'vangogh_palettes' list

discrete

whether to use a discrete colour palette

alpha

transparency

reverse

logical, Reverse the order of the colours?

Value

A scale_color_vangogh function

Examples

library(ggplot2)
ggplot(mtcars, aes(mpg, wt)) +
  geom_point(aes(colour = factor(cyl))) +
  scale_colour_vangogh(palette = "StarryNight")
ggplot(mtcars, aes(mpg, wt)) +
  geom_point(aes(colour = hp)) +
  scale_colour_vangogh(palette = "StarryNight", discrete = FALSE)
ggplot(data = mpg) +
  geom_point(mapping = aes(x = displ, y = hwy, color = class)) +
  scale_colour_vangogh(palette = "StarryRhone")
ggplot(diamonds) +
  geom_bar(aes(x = cut, fill = clarity)) +
  scale_fill_vangogh()

#' Setup fill palette for ggplot2

Description

#' Setup fill palette for ggplot2

Usage

scale_fill_vangogh(
  ...,
  palette = "StarryNight",
  discrete = TRUE,
  alpha = 1,
  reverse = TRUE
)

Arguments

...

additional arguments to pass to scale_color_gradientn

palette

Choose from 'vangogh_palettes' list

discrete

whether to use a discrete colour palette

alpha

The alpha transparency, a number in [0,1], see argument alpha in hsv.

reverse

If TRUE, the direction of the colours is reversed.

Value

A scale_fill_vangogh function


vangogh

Description

list of palettes generated from Vincent van Gogh's paintings

Details

list of palettes generated from Vincent van Gogh's paintings


vangogh palette with ramped colours

Description

vangogh palette with ramped colours

Usage

vangogh_pal(palette = "StarryRhone", alpha = 1, reverse = FALSE)

Arguments

palette

Choose from 'vangogh_palettes' list

alpha

transparency

reverse

If TRUE, the direction of the colours is reversed.

Value

Palettes with ramped colors from predefined palettes

Examples

library(scales)
show_col(vangogh_pal()(10))

filled.contour(volcano, color.palette = vangogh_pal(), asp = 1)

A Van Gogh color palette generator.

Description

These are some color palettes from a selection of Vincent van Gogh's paintings.

Usage

vangogh_palette(name, n, type = c("discrete", "continuous"))

Arguments

name

Name of desired palette. Choices are: StarryNight, StarryRhone, SelfPortrait, CafeTerrace, Eglise, Irises, SunflowersMunich, SunflowersLondon, Rest ,Bedroom , CafeDeNuit, Chaise, Shoes, Landscape, Cypresses

n

Number of colors desired. All palettes have a standard of 5 colors. If omitted, uses all colors.

type

Either "continuous" or "discrete". Use "continuous" to automatically interpolate between colours. @importFrom graphics rgb rect par image text

Value

A vector of colors.

Examples

vangogh_palette("StarryNight")
vangogh_palette("SelfPortrait")
vangogh_palette("Cypresses")
vangogh_palette("Cypresses", 3)

# If you want a continous paletted based on the colors already found in the preset
# palettes, you can interpolate between existing colours accordingly.
pal <- vangogh_palette(21, name = "StarryRhone", type = "continuous")

Complete list of palettes:

Description

Use vangogh_palette to construct palettes of desired length.

Usage

vangogh_palettes

Format

An object of class list of length 15.


Show a single palette

Description

Display a single palette to see whether it meets your needs. If no num parameter is given, all the colours in the palette will be displayed. If num is less than the number of colours in the palette, then only the first num colours will be displayed. If num is greater than the number of colours in the palette, then that many colours will be generated by linear interpolation over the vector of colours in the chosen palette.

Usage

viz_palette(pal, ttl = deparse(substitute(pal)), num = length(pal))

Arguments

pal

character, vector of (hexadecimal) colours representing a palette

ttl

character, title to be displayed (the name of the palette)

num

numeric, the number of colours to display

Value

A vector of colors from a single palette

Examples

viz_palette(vangogh_palettes$StarryNight)
viz_palette(vangogh_palettes$StarryNight, "StarryNight")
viz_palette(vangogh_palettes$StarryNight, "StarryNight first 4", num = 4)
viz_palette(vangogh_palettes$StarryNight, "StarryNight interpolated to 25", num = 25)