protomapr/man/pmPaletteStyle.Rd
2026-03-06 15:46:39 +11:00

57 lines
1.3 KiB
R

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/palette.R
\name{pmPaletteStyle}
\alias{pmPaletteStyle}
\title{Create a Themed Palette Style}
\usage{
pmPaletteStyle(
palette,
water_color = NULL,
land_color = "#f8f8f8",
labels = TRUE,
label_color = "#333333"
)
}
\arguments{
\item{palette}{Character vector of colors or palette function.}
\item{water_color}{Character. Color for water features. If NULL, uses
first color from palette.}
\item{land_color}{Character. Color for land/background. Default is "#f8f8f8".}
\item{labels}{Logical. Whether to include city labels. Default is TRUE.}
\item{label_color}{Character. Color for labels. Default is "#333333".}
}
\value{
A pm_style object.
}
\description{
Creates a complete pm_style using a color palette. Combines pmPalette()
with styling for a consistent look.
}
\examples{
\dontrun{
library(leaflet)
library(protomapr)
# Viridis-themed map
if (requireNamespace("viridisLite", quietly = TRUE)) {
style <- pmPaletteStyle(viridisLite::viridis(5, option = "D"))
leaflet() \%>\%
setView(lng = -122.4, lat = 37.8, zoom = 12) \%>\%
addProtomaps(url = protomaps_url(), style = style)
}
# Custom palette
style <- pmPaletteStyle(
c("#264653", "#2a9d8f", "#e9c46a", "#f4a261", "#e76f51"),
water_color = "#264653"
)
}
}
\seealso{
\code{\link{pmPalette}}, \code{\link{pmStyle}}
}