#' IDS Theme for ggplot2
#'
#' Based on Highcharts ggtheme \link[ggthemes]{theme_hc}
#' which again is based on the plots in \url{Highcharts JS}.
#'
#' @note
#'
#' Note that here, unlike with the highcharter theme, you have to set the scale
#' explicitly.
#'
#'
#' @references
#'
#' \link[ggthemes]{theme_hc}
#'
#' \url{http://www.highcharts.com/demo/line-basic}
#'
#' \url{https://github.com/highslide-software/highcharts.com/tree/master/js/themes}
#'
#' @inheritParams ggplot2::theme_bw
#' @param style \code{'light'}, \code{'dark'}.
#' @param bgcolor Deprecated
#' @example inst/examples/ex-ggplot.R
#' @family themes ids
#' @importFrom ggplot2 theme element_rect element_text element_line element_blank
#' @export
theme_ids <- function(base_size = 12,
                     base_family = idsBaseFontFamily,
                     style = c("default", "light", "dark"),
                     bgcolor = NULL) {

  if (!is.null(bgcolor)) {
    warning("`bgcolor` is deprecated. Use `style` instead.")
    style <- bgcolor
  }
  style <- match.arg(style)
  bgcolor <- switch(style,
                    default = backgroundColor,
                    "light" = backgroundColor,
                    "mono" = backgroundColor,
                    "dark" = backgroundColorDark)

  ret <- theme(rect = element_rect(fill = bgcolor, linetype = 0, colour = NA),
               text = element_text(size = base_size, family = base_family),
               plot.title = element_text(hjust = 0.5),
               plot.subtitle = element_text(hjust = 0.5, size = 13, colour = mediumContrastColor),
               title = element_text(hjust = 0.5),
               axis.title.x = element_text(hjust = 0.5, size = 11,
                                           colour = mediumContrastColor),
               axis.title.y = element_text(hjust = 0.5, size = 11,
                                           margin = margin(r = 10),
                                           colour = mediumContrastColor),
               legend.title = element_text(size=11, colour = mediumContrastColor),
               panel.grid.major.x = element_line(linetype = "dotted", colour = lowContrastColor),
               panel.grid.major.y = element_line(colour = lowContrastColor),
               panel.grid.minor.y = element_blank(),
               panel.grid.minor.x = element_blank(),
               panel.border = element_blank(),
               panel.background = element_blank(),
               legend.position = "right",
               legend.key = element_rect(fill = paste0(bgcolor,"00")))

  if (style == "dark") {
    ret <- (ret + theme(rect = element_rect(fill = bgcolor),
                        text = element_text(colour = textColorDark),
                        plot.title = element_text(colour = highContrastColorDark),
                        plot.subtitle = element_text(colour = mediumContrastColorDark),
                        axis.title.x = element_text(colour = textColorDark),
                        axis.title.y = element_text(colour = textColorDark),
                        axis.text.x = element_text(color=textColorDark),
                        axis.text.y = element_text(color=textColorDark),
                        panel.grid.major.y = element_line(colour = lowContrastColorDark),
                        legend.title = element_text(colour = textColorDark)))
  }
  ret
}


#' IDS color and fill scales
#'
#' Colour and fill scales which use the palettes in
#' \code{\link{ids_pal}()} and are meant for use with
#' \code{\link{theme_ids}()}.
#'
#' @param palette A palette function that when called with a single integer
#' argument (the number of levels in the scale) returns the values that they should take.
#'
#' @importFrom ggthemes gdocs_pal
#' @importFrom ggplot2 discrete_scale
#'
#' @inheritDotParams  ggthemes::scale_colour_gdocs
#' @family colour ids
#' @rdname scale_ids
#' @export
scale_colour_ids <- function(palette = "default", ...) {
  discrete_scale("colour", "ids", ids_pal(palette=palette, ...))
}

#' @rdname scale_ids
#' @inheritDotParams  ggthemes::scale_colour_gdocs
#' @importFrom ggplot2 discrete_scale
#' @export
scale_color_ids <- scale_colour_ids

#' @rdname scale_ids
#' @inheritParams ggthemes::scale_fill_gdocs
#' @importFrom ggplot2 discrete_scale
#' @export
scale_fill_ids <- function(palette = "default", ...) {
  discrete_scale("fill", "ids", ids_pal(palette=palette, ...))
}
