@import "compatibility";

////
/// @group settings/colours
////

/// Use 'legacy' colour palette
///
/// Whether or not to use the colour palette from GOV.UK Elements / Frontend
/// Toolkit, for teams that are migrating to GOV.UK Frontend and may be using
/// components from both places in a single application.
///
/// @type Boolean
/// @access public

$govuk-use-legacy-palette: if((
    $govuk-compatibility-govukfrontendtoolkit or
    $govuk-compatibility-govuktemplate or
    $govuk-compatibility-govukelements
  ), true, false) !default;

/// Legacy colour palette
///
/// This exists only because you cannot easily set a !default variable
/// conditionally (thanks to the way scope works in Sass) so we set
/// `$govuk-colour-palette` using the `if` function.
///
/// @access private

$_govuk-colour-palette-legacy: (
  "purple": #2e358b,
  "light-purple": #6f72af,
  "bright-purple": #912b88,
  "pink": #d53880,
  "light-pink": #f499be,
  "red": #b10e1e,
  "bright-red": #df3034,
  "orange": #f47738,
  "brown": #b58840,
  "yellow": #ffbf47,
  "light-green": #85994b,
  "green": #006435,
  "turquoise": #28a197,
  "light-blue": #2b8cc4,
  "blue": #005ea5,

  "black": #0b0c0c,
  "grey-1": #6f777b,
  "grey-2": #bfc1c3,
  "grey-3": #dee0e2,
  "grey-4": #f8f8f8,
  "white": #ffffff
);

/// Modern colour palette
///
/// This exists only because you cannot easily set a !default variable
/// conditionally (thanks to the way scope works in Sass) so we set
/// `$govuk-colour-palette` using the `if` function.
///
/// @access private

$_govuk-colour-palette-modern: (
  "red": #d4351c,
  "yellow": #ffdd00,
  "green": #00703c,
  "blue": #1d70b8,
  "dark-blue": #003078,
  "light-blue": #5694ca,
  "purple": #4c2c92,

  "black": #0b0c0c,
  "dark-grey": #6f777b,
  "mid-grey": #b1b4b6,
  "light-grey": #f3f2f1,
  "white": #ffffff,

  "light-purple": #6f72af,
  "bright-purple": #912b88,
  "pink": #d53880,
  "light-pink": #f499be,
  "orange": #f47738,
  "brown": #b58840,
  "light-green": #85994b,
  "turquoise": #28a197
);

/// Colour palette
///
/// @type Map
///
/// @prop $colour - Representation for the given $colour, where $colour is the
///   friendly name for the colour (e.g. "red": #ff0000);
///
/// @access public

$govuk-colours: if(
  $govuk-use-legacy-palette,
  $_govuk-colour-palette-legacy,
  $_govuk-colour-palette-modern
) !default;
