dh_shorten: Convert a Full Hex Code to Shorthand Code

Description Usage Arguments Value Examples

View source: R/dehex.R

Description

Takes a hex code like '#C0FFEE' and simplifies to '#CFE' (i.e. the first character from each character pair).

Usage

1
dh_shorten(hex_code)

Arguments

hex_code

Character. A valid hex colour code starting with a hash mark (#). Characters must take the values 0 to 9 or A to F (case insensitive).

Value

Character. A shortened hex colour code: a hash mark followed by three characters (0 to 9, A to F).

Examples

1
dh_shorten("#C0FFEE")

matt-dray/dehex documentation built on Feb. 25, 2022, 10:23 a.m.