get_alpha: Get color's transparency

Description Usage Arguments Value Examples

Description

Get the transparency of a color vector.

Usage

1
get_alpha(x, na.rm = FALSE)

Arguments

x

a any type color string or a javascript color object specifying.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

Value

Returns the alpha value of a color vector, from 0-1.

Examples

1
2
3
get_alpha("red")
get_alpha("#808080A0")
get_alpha("{ h: 0.5, s: 0.5, v: 0.5 }")

houyunhuang/tinycolor documentation built on June 6, 2019, 7:43 p.m.