The purpose of {dehex} is to train how to 'read' the colour from a hex code. This function generates a random hex code for you so you can test your skills.

dh_random(shorten = FALSE)

Arguments

shorten

Logical. Shorten six-character hex colour code to three characters? The three-character hex code is what is used to interpret the colour in the {dehex} 'training' context.

Value

Character string of length one. A three- or six-character hex code preceded by a hash mark, '#'.

Examples

dh_random(TRUE)
#> [1] "#A27"