discrete.palette: Function to provide a user-defined discrete color palette

View source: R/discrete_palette.R

discrete.paletteR Documentation

Function to provide a user-defined discrete color palette

Description

This function aims to give a 'discrete' palette, that is, a palette without gradient and with some user-defined repeated colors.

Usage

discrete.palette (ncols, cols, freqs, steps)

Arguments

ncols

The number of colors to be outputted. Must be equal or superior to the length of cols

cols

The colors to be used.

freqs

Optional. The proportions for the repartition of the colors. By default, proportions are all equal.

steps

Optional. The value of the steps the colors represent.

Details

The function takes as input the colors the user wants to repeat, and optionally their proportions if it is not intended to distribute them equally. The equal distribution may not be fully true: if needed, proportional samples are rounded to have an integer number of repeats of each color. The goal is rather to output the specified number of colors the user wants.

Value

A vector that contains ncols color codes, with all cols repeated.


jacobmaugoust/ULT documentation built on May 16, 2023, 1:29 p.m.