Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

convert_colour

Convert Colour


Description

Converts colours between RRGGBBAA and hex strings, in both directions.

Usage

convert_colour(x)

convert_colours(x)

convert_color(x)

convert_colors(x)

Arguments

x

character vector of hex strings, or numeric matrix of RRGGBBAA values

Details

If a combination of hex strings with and without alpha values are supplied, those without are assumed to have an alpha value of FF and will be returned in the RRGGBBAA matrix

Examples

convert_colour(c("#FFAA00"))
convert_colour(c("#FFAA00","#FF00AAFF"))

convert_colour(matrix(c(255,170,0),ncol = 3))
convert_colour(matrix(c(255,170,0,255),ncol = 4))

colourvalues

Assigns Colours to Values

v0.3.7
GPL-3
Authors
David Cooley [aut, cre]
Initial release
2020-12-02

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.