get_format: Get color format

Description Usage Arguments Value Examples

Description

Get the name of color format, Hex, Rgb, Hsl, Hsv, Name, and so on.

Usage

1
get_format(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 a string vector of the color format name.

Examples

1
2
3
4
5
6
get_format("#F3A212") # "HEX"
get_format("#F3A21222") # “HEX8”
get_format("{ r: 1, g: 0, b: 0 }") # "RGB"
get_format("{ h: 0.5, s: 0.5, v: 0.5 }") # "HSL"
get_format("{ h: 0.5, s: 0.5, v: 0.5 }") # "HSV"
get_format('red') # "NAME"

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