hexn: Generate hex colour codes

View source: R/fn_all.R

hexnR Documentation

Generate hex colour codes

Description

Generate a vector of hex colour codes for the desired number of colours. Colours are generated by evenly splitting hue in the range ⁠[0,360]⁠ in the HCL colour space using grDevices::hcl. The output is meant to follow the default colours used in ggplot2::ggplot2.

Usage

hexn(n, show = FALSE)

Arguments

n

⁠<int>⁠ Number of colours to output.

show

⁠<lgl>⁠ TRUE to show the output colours.

Value

A vector of hex colour codes that can be used for plotting.

Examples

hexn(6,FALSE)
hexn(4,TRUE)

edar documentation built on Nov. 15, 2026, 1:07 a.m.