% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/chart_theme.R
\name{set_theme}
\alias{set_theme}
\title{Set or List Chart Themes}
\usage{
set_theme(name, ...)
}
\arguments{
\item{name}{An optional \link{character} string matching one of the available
theme names. Partial matching is supported. If omitted (and no \code{...}
overrides are given), returns the available theme names instead.}

\item{...}{Named color overrides applied after the base theme. Valid names
include any theme property: \code{bearish_body}, \code{bearish_wick},
\code{bearish_border}, \code{bullish_body}, \code{bullish_wick}, \code{bullish_border},
\code{background_color}, \code{foreground_color}, \code{text_color}, \code{gridcolor},
\code{threshold_color}, and \code{colorway} (a character vector of up to 10
colors).}
}
\value{
When called without arguments, a \link{character} vector of available theme
names. Otherwise, invisibly returns \code{NULL}; the theme is applied as a
side effect to the internal chart-variables state.
}
\description{
Apply a named color theme to the charting system, override individual
theme properties, or list all available theme names.

Theme changes take effect immediately and apply to all subsequent
\code{\link[=chart]{chart()}} and \code{\link[=indicator]{indicator()}} calls.
}
\details{
\code{set_theme} supports three usage patterns:

\describe{
\item{\code{set_theme()}}{Returns a character vector of available theme names.}
\item{\code{set_theme("payout")}}{Applies the named theme.}
\item{\code{set_theme$payout}}{Applies the named theme via \code{$} syntax (supports
tab-completion in interactive sessions).}
}

Themes can be combined with individual color overrides. When both \code{name}
and \code{...} are provided, the base theme is applied first, then the
overrides are applied on top:

\if{html}{\out{<div class="sourceCode r">}}\preformatted{# Apply "payout" but with a custom background
set_theme("payout", background_color = "#000000")
}\if{html}{\out{</div>}}

It is also possible to override individual properties without selecting a
theme:

\if{html}{\out{<div class="sourceCode r">}}\preformatted{# Change only the bearish candle color
set_theme(bearish_body = "#FF0000")
}\if{html}{\out{</div>}}

See \link{chart_themes} for a full description of all available themes and
their color properties.
}
\examples{
## list available themes
talib::set_theme()

## apply a theme by name
talib::set_theme("payout")

## apply a theme with custom overrides
talib::set_theme(
  "hawks_and_doves",
  background_color = "#FAFAFA"
)

## override individual properties
## without switching theme
talib::set_theme(
  bearish_body = "#FF4444",
  bullish_body = "#44FF44"
)

## reset to default theme
talib::set_theme("default")
}
\seealso{
\link{chart_themes} for descriptions of each theme, \code{\link[=chart]{chart()}} for
creating charts.

Other Charting:
\code{\link[=chart]{chart()}},
\code{\link{chart_themes}},
\code{\link[=indicator]{indicator()}}
}
\concept{Charting}
