set_alpha: Set alpha value of integer colors

View source: R/col_to_rgb.R

set_alphaR Documentation

Set alpha value of integer colors

Description

Set alpha value of integer colors

Usage

set_alpha(icol, alpha)

Arguments

icol

Integer vector (where the 4 bytes making up each integer represent the RGBA values of the color)

alpha

numeric alpha value in range [0, 1]. Length of 1, or same length as 'col'

Value

integer vector of colors with adjusted alpha channel

Examples

icol <- col_to_int('red')
icol
int_to_col(icol)
icol2 <- set_alpha(icol, 0.5)
int_to_col(icol2)

colorfast documentation built on April 4, 2025, 1:03 a.m.