R/addAlphaRetainColor.R

# addAlphaRetainColor <- function(color,
#                                 transparency,
#                                 background = "#ffffff") {
#   col_rgb <- grDevices::col2rgb(color);
#   bg_rgb <- grDevices::col2rgb(background);
#   toLighter = mean(col_rgb) < mean(bg_rgb);
#   fullInvisibility
#   if (toLighter) {
#     lowest = which(col_rgb == min(col_rgb));
#     lowestNew <- bg_rgb[lowest] - col_rgb[lowest]
#   }
# }

Try the ufs package in your browser

Any scripts or data that you put into this service are public.

ufs documentation built on July 9, 2023, 6:07 p.m.