Learn R Programming

tinter (version 0.1.0)

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

Description

Generate shades, tints or both from a colour.

Usage

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

Run this code
# NOT RUN {
tinter("blue")
tinter("#fa6a5c", steps = 10, crop = 3)
tinter("#fa6a5c", direction = "tints")
# }

Run the code above in your browser using DataLab