forked from satijalab/seurat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BGTextColor.Rd
43 lines (38 loc) · 1.15 KB
/
BGTextColor.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/visualization.R
\name{BGTextColor}
\alias{BGTextColor}
\title{Determine text color based on background color}
\source{
\url{https://stackoverflow.com/questions/3942878/how-to-decide-font-color-in-white-or-black-depending-on-background-color}
}
\usage{
BGTextColor(
background,
threshold = 186,
w3c = FALSE,
dark = "black",
light = "white"
)
}
\arguments{
\item{background}{A vector of background colors; supports R color names and
hexadecimal codes}
\item{threshold}{Intensity threshold for light/dark cutoff; intensities
greater than \code{theshold} yield \code{dark}, others yield \code{light}}
\item{w3c}{Use \href{https://www.w3.org/TR/WCAG20/}{W3C} formula for calculating
background text color; ignores \code{threshold}}
\item{dark}{Color for dark text}
\item{light}{Color for light text}
}
\value{
A named vector of either \code{dark} or \code{light}, depending on
\code{background}; names of vector are \code{background}
}
\description{
Determine text color based on background color
}
\examples{
BGTextColor(background = c('black', 'white', '#E76BF3'))
}
\concept{visualization}