% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/IPS_helper.R
\name{mapcolors}
\alias{mapcolors}
\title{Map Score to Color}
\usage{
mapcolors(x, my_palette = NULL)
}
\arguments{
\item{x}{Numeric value to be mapped to a color (typically between -3 and 3).}

\item{my_palette}{Color palette vector (should have 1001 colors).
Default uses blue-white-red gradient.}
}
\value{
A color from the palette as a hex code.
}
\description{
Maps a numeric input value to a color from a blue-white-red gradient palette.
Values are mapped to a 1001-color palette where -3 maps to blue, 0 maps to white,
and +3 maps to red.
}
\examples{
my_palette <- grDevices::colorRampPalette(c("blue", "white", "red"))(1001)
color <- mapcolors(2, my_palette)
color <- mapcolors(-2, my_palette)
}
