Skip to content

region color set #73

Description

@hanguojun007

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions