Skip to contents

Return available identifying information on the given color.

Usage

get_color_thecolorapi(
  hex = NULL,
  rgb = NULL,
  hsl = NULL,
  cmyk = NULL,
  format = "json",
  w = 100,
  named = TRUE,
  return_name_only = TRUE
)

Arguments

hex

string (optional), Valid hex code.

rgb

string (optional), Valid rgb color.

hsl

string (optional), Valid hsl color.

cmyk

string (optional) Valid cmyk color.

format

string (optional). Return results as JSON, SVG or HTML page. Example: "html".

w

integer (optional). Height of resulting image, only applicable on SVG format. Example: 350.

named

boolean (optional) Whether to print the color names on resulting image, only applicable on SVG format. Example: FALSE.

return_name_only

boolean. if TRUE returns color name only

Value

A character string.

Examples

if (FALSE) {
get_color_thecolorapi(hex = "0047AB")
get_color_thecolorapi(rgb = paste(0,71,171, sep = ","))
get_color_thecolorapi(hsl = paste("215","100%","34%", sep = ","))
get_color_thecolorapi(cmyk = paste(100,58,0,33, sep = ","))
}