setVennColors: Change set colors

View source: R/nVenn2.R

setVennColorsR Documentation

Change set colors

Description

Change set colors

Usage

setVennColors(nVennObj, colorList, plot = TRUE)

Arguments

nVennObj

nVenn object created with nVennDiagram().

colorList

Vector or list of colors for the sets (see Details).

plot

If true (default), plots the diagram after setting the colors.

Details

If a vector of svg-formatted colors is provided, they will be used in the same order. This is a good way to create and use a custom color palette. If a list is used, the function will call setVennColor() with the names in the list.

It is important to notice that each color must be a valid color in SVG format. The value is not checked, and therefore an incorrect value may break the plot in plotVenn() or lead to unexpected results.

Value

nVenn object with changed set colors.

Examples

myv <- nVennDiagram(list(Set1=c("a", "b", "c"), Set2=c("a", "c", "d")), verbose=FALSE)
mypalette <- c("black", "#ffff00", "red")
myv <- setVennColors(myv, mypalette)

nVennR2 documentation built on July 14, 2026, 1:09 a.m.