goodcolors: Return a good set of colors to use for clusters in admixture...

View source: R/DAPC_adegenet.R

goodcolorsR Documentation

Return a good set of colors to use for clusters in admixture plots. Generate an optimal set of colors for an admixture plot and particular K (number of clusters), while considering colorblindness.

Description

Return a good set of colors to use for clusters in admixture plots.

Generate an optimal set of colors for an admixture plot and particular K (number of clusters), while considering colorblindness.

Usage

goodcolors(n, thresh = 65, iter = 50, cbspace = c("prot", "deut", "trit"))

Arguments

n

Number of colors to include in the output set.

thresh

Minimum color distance between any pair of colors in the output set. This will be ignored if not met after 'iter' attempts. Default is 65. Values lower than this tend to result in some colors being too similar to easily distinguish. It will be difficult to find sets with more than 10 colors sets larger than 10 colors (with cbspace=NULL) if thresh is >80.

iter

Number of times to try to find a set of colors that meet 'thresh'.

cbspace

Character vector indicating which colorblind-transformed sets of colors should also meet thresh. Default is "prot","deut","trit", but it becomes difficult to find a passing color set when n > 4 using the defaults.

Value

Character vector of hex color codes.


JeffWeinell/misc.wrappers documentation built on Sept. 20, 2023, 12:42 p.m.