Determine if colors are blank colors

isColorBlank(
  x,
  c_max = 7,
  l_min = 95,
  alpha_max = 0.1,
  blankColor = c("#FFFFFF", "#FFFFFFFF", "transparent"),
  ...
)

Arguments

x

character vector of R colors.

c_max

maximum chroma as determined by HCL color space, in range of no color 0 to maximum color 100.

l_min

numeric minimum luminance required for a color to be considered blank, combined with the c_max argument. This threshold prevents grey colors from being considered blank, unless their luminance is above this threshold.

alpha_max

numeric value indicating the alpha transparency below which a color is considered blank, in range of fully transparent 0, to fully non-transparent 1.

blankColor

character vector of R colors directly matched to the input x vector. The value "transparent" is useful here, because it is not easily converted to HCL color space.

...

additional arguments are ignored.

Details

This function takes a vector of colors and determines if each color is considered a "blank color", based upon direct match and the color chroma saturation and luminance. For example, extremely pale colors from colorjam::vals2colorLevels() may be considered "blank" if the color saturation is extremely low. Similarly, colors with extremely high alpha transparency may be considered "blank".