tinter: Generate shades, tints or both from a colour.

Description Usage Arguments Value Examples

View source: R/tinter.R

Description

Generate shades, tints or both from a colour.

Usage

1
tinter(x, steps = 5, crop = 1, direction = "both", adjust = 0)

Arguments

x

A string of a colour in any format accepted by grDevices::col2rgb().

steps

An integer indicating how many shades/tints to generate (excluding x).

crop

An integer indicating how many extreme colours to remove (e.g. crop = 1 eliminates 'black' and 'white').

direction

A string indicating whether to include 'tints', 'shades' or 'both'.

adjust

A number between -1 and 1. Values between 0 and -1 increasingly darken colour; values between 0 and 1 increasingly lighten colour.

Value

A vector of colours.

Examples

1
2
3
tinter("blue")
tinter("#fa6a5c", steps = 10, crop = 3)
tinter("#fa6a5c", direction = "tints")

Example output

[1] "#CCCCFF" "#9999FF" "#6666FF" "#3333FF" "#0000FF" "#0000CC" "#000099"
[8] "#000065" "#000032"
 [1] "#FDD2CE" "#FDC3BD" "#FCB4AD" "#FBA59D" "#FB968C" "#FB877C" "#FA786C"
 [8] "#FA6A5C" "#E15F52" "#C85449" "#AF4A40" "#953F37" "#7D352E" "#632A24"
[15] "#4A1F1B"
[1] "#FEE1DE" "#FDC3BD" "#FBA59D" "#FB877C" "#FA6A5C"

tinter documentation built on April 19, 2020, 4:15 p.m.