hi, i can't discribe my problem? but i show the code for you.
colorSet <- setNames(defaultColor[1:length(diffSet)], names(diffSet))
#' 将多个颜色进行均匀混合
CombineColor <- function(colors) {
num <- length(colors)
mix_rgb <- col2rgb("black")
for (col in colors) {
mix_rgb <- mix_rgb + col2rgb(col) / 255 / num
}
res <- rgb(mix_rgb[1], mix_rgb[2], mix_rgb[3])
return(res)
}
venn_regionedge_my <- function(data, colorSet) {
region <- ggVennDiagram::venn_regionedge(data) %>%
dplyr::rowwise() %>%
dplyr::mutate(color = CombineColor(colorSet[stringr::str_split_1(name, "/")]))
}
could you add a function to it?
hi, i can't discribe my problem? but i show the code for you.
could you add a function to it?