GenBrksCols <- function(var, n = 21, digits = 2) {
  if (!is.numeric(var)) {
    stop("Parameter 'var' must be numeric.")
  }
  varlim <- signif(c(min(var, na.rm = TRUE), max(var, na.rm = TRUE)), 4)
  if (!is.numeric(n)) {
    stop("Parameter 'n' must be an integer.")
  }
  n <- round(n)
  if (!is.numeric(digits)) {
    stop("Parameter 'digits' must be an integer.")
  }
  digits <- round(digits)

  brks <- round(seq(varlim[1], varlim[2], length.out = n), digits)
  cols <- clim.colors(length(brks) - 1)
  list(brks = brks, cols = cols)
}
