get_shade: Get an RGB string representing the color and opacity given

View source: R/colors.R

get_shadeR Documentation

Get an RGB string representing the color and opacity given

Description

Get an RGB string representing the color and opacity given

Usage

get_shade(color, opacity = 0)

Arguments

color

A vector of R color strings or numbers

opacity

An integer between 0 an 99 representing percentage opaque

Value

A vector of RGB strings of the specified colors and opacity Format of returned string is #RRGGBBAA where RR = red, a 2-hexadecimal-digit string GG = green, a 2-hexadecimal-digit string BB = blue, a 2-hexadecimal-digit string AA = alpha or opacity

Examples

library(gfutilities)
get_shade("blue", 1)
get_shade("salmon")
get_shade(c(1, 2, 3), 50)
get_shade(c("red", "blue", "yellow"), 20)

pbs-assess/gfutilities documentation built on Sept. 18, 2023, 7:57 a.m.