#' Load example RGB image
#'
#' Provides the file path to an example RGB image included in the package.
#' Optionally allows saving the image to a user-specified location.
#'
#' @param save_path Optional file path to save the example image.
#'
#' @return
#' A character string representing the file path to the example RGB image.
#'
#' @examples
#' # Get example image path
#' img_path <- rgb_example()
#' img_path
#'
#' # Save image to temporary location
#' rgb_example(tempfile(fileext = ".jpg"))
#'
#' @export
rgb_example <- function(save_path = NULL){
  
  path <- system.file(
    "extdata",
    "example.jpg",
    package = "rgbIndices",
    mustWork = TRUE
  )
  
  if (!is.null(save_path)) {
    file.copy(path, save_path, overwrite = TRUE)
  }
  
  return(path)
}