Fix yellow color to be less green than default "yellow"

fixYellow(col, Hrange = c(70, 100), Hshift = -20, fixup = TRUE, ...)

Arguments

col

R color, either in hex color format or using values from colors().

Hrange

numeric vector whose range defines the region of hues to be adjusted. By default hues between 80 and 90 are adjusted. If NULL, HCL is return unchanged.

Hshift

numeric value length one, used to adjust the hue of colors within the range Hrange. If NULL, HCL is return unchanged.

...

additional arguments are passed to col2hcl(), and hcl2col().

Value

returns a vector of R colors the same length as input col. In the event col, Hrange, or Hshift have length 0, or if any step in the conversion produces length 0, then the original col is returned.

Details

This function "fixes" the color yellow, which by default appears green especially when darkened. The effect of this function is to make yellows appear more red, which appears more visibly yellow even when the color is darkened.

This function is intended to be tolerant to missing values. For example if any of the values col, Hrange, or Hshift are length 0, the original col is returned unchanged.

Examples

yellows <- vigrep("yellow", colors());
fixedYellows <- fixYellow(yellows);
showColors(list(yellows=yellows,
   fixedYellows=fixedYellows));