make_color_contrast: Make color contrast

make_color_contrastR Documentation

Make color contrast

Description

Make color contrast

Usage

make_color_contrast(
  x,
  y = NULL,
  bg = "white",
  L_threshold = 65,
  C_floor = 90,
  L_hi = 95,
  L_lo = 40,
  blend_preset = "ryb",
  do_plot = FALSE,
  cex = 2,
  ...
)

Arguments

blend_preset

character string passed as preset to colorjam::blend_colors() to define the color wheel used during color blending operations.

Details

This function provides a simple method to ensure a color has adequate visual contrast with a background color, while retaining some color saturation. For example, red on red background will return something close to pink, so the pink retains the red color saturation but is visually distinct from the background color red.

Similarly, pink on pink will return something close to red.

See Also

Other venndir utility: curate_venn_labels(), expand_range(), make_venn_combn_df(), make_venn_test(), match_list(), nudge_venndir_label(), print_color_df(), shrink_df(), three_point_angle(), venndir_legender(), venndir_to_df()

Examples

x <- c("firebrick", "dodgerblue", "gold", "pink", "white");
y <- rep("red3", 4);
make_color_contrast(x, y, do_plot=TRUE);

y <- rep("pink1", 4);
make_color_contrast(x, y, do_plot=TRUE);

y <- rep("gold", 4);
make_color_contrast(x, y, do_plot=TRUE);

y <- c("red4", "aquamarine4", "blue3", "yellow", "pink2")
make_color_contrast(x, y, do_plot=TRUE, C_floor=140);


jmw86069/venndir documentation built on Nov. 14, 2024, 10:12 a.m.