% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/glass-theme.R
\name{update_glass_theme}
\alias{update_glass_theme}
\title{Update glass theme options in a running app}
\usage{
update_glass_theme(
  session,
  preset = NULL,
  tint = NULL,
  primary = NULL,
  intensity = NULL
)
}
\arguments{
\item{session}{A Shiny session object (usually the \code{session} argument of
the server function).}

\item{preset}{Optional. \code{"light"}, \code{"dark"}, or \code{"auto"}.}

\item{tint}{Optional logical. Enable or disable content-aware ambient tint.}

\item{primary}{Optional accent color (hex like \code{"#AF52DE"} or \code{rgb()}).}

\item{intensity}{Optional numeric in \eqn{[0, 1]}: Ultra Clear (\code{0}) to
Tinted (\code{1}).}
}
\value{
\code{session}, invisibly.
}
\description{
Send a message to the browser to change the Liquid Glass preset, accent
color, intensity, or content-tint behavior without reloading the page.
Requires a page that used \code{\link[=glass_theme]{glass_theme()}} (so \code{shiny-glass.js} is loaded).
}
\details{
\code{primary} updates CSS variables (\code{--bs-primary}, \code{--bs-primary-rgb},
\code{--glass-primary}) so buttons, checks, and other accent surfaces follow the
new color. Sass-baked one-off colors may not all switch until a full reload.
\code{intensity} updates fill/blur along the Ultra Clear to Tinted spectrum
(see \code{\link[=glass_intensity_slider]{glass_intensity_slider()}}).
}
\examples{
if (interactive()) {
  library(shiny)
  library(shinyglass)

  ui <- fluidPage(
    theme = glass_theme(),
    glass_theme_toggle(),
    selectInput("accent", "Accent", c("#007AFF", "#AF52DE", "#FF9500"))
  )

  server <- function(input, output, session) {
    observe_glass_theme_toggle(input, session)
    observeEvent(input$accent, {
      update_glass_theme(session, primary = input$accent)
    }, ignoreInit = TRUE)
  }

  shinyApp(ui, server)
}

}
