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DAAwD;AAC1D","file":"_colour.scss","sourcesContent":["@import \"../settings/colours-palette\";\n@import \"../settings/colours-organisations\";\n@import \"../settings/warnings\";\n\n////\n/// @group helpers/colour\n////\n\n/// Get colour\n///\n/// @param {String | Colour} $colour - Name of colour from the colour palette\n/// (`$govuk-colours`)\n/// @param {String | Colour | Boolean} $legacy [false] - Deprecated.\n/// The `$legacy` parameter is deprecated and is non-operational, as the\n/// legacy colour palette has been removed. The parameter will be removed in\n/// the next major version.\n/// @return {Colour} Representation of named colour\n///\n/// @throw if `$colour` is not a colour from the colour palette\n/// @access public\n\n@function govuk-colour($colour, $legacy: false) {\n // Output a warning if $legacy is set to anything.\n @if $legacy and _should-warn(\"legacy-colour-param\") {\n @warn _warning-text(\"legacy-colour-param\", \"The `$legacy` parameter of \" +\n \"`govuk-colour` is deprecated and is non-operational. It will be \" +\n \"removed in the next major version.\");\n }\n\n @if type-of($colour) == \"color\" {\n // stylelint-disable-next-line scss/function-quote-no-quoted-strings-inside\n $colour: quote(\"#{$colour}\");\n }\n\n @if not map-has-key($govuk-colours, $colour) {\n @error \"Unknown colour `#{$colour}`\";\n }\n\n @return map-get($govuk-colours, $colour);\n}\n\n/// Get the colour for a government organisation\n///\n/// @param {String} $organisation - Organisation name, lowercase, hyphenated\n/// @param {Boolean} $websafe - Deprecated. Use $contrast-safe instead.\n/// @param {Boolean} $contrast-safe [true] - By default a version of the colour\n/// will be returned which has a minimum 4.5:1 contrast ratio when used with\n/// white, as per the WCAG 2.1 Level AA guidelines. If you want to use the\n/// non-contrast safe version you can set this to `false` but your should\n/// ensure that you still meets contrast requirements for accessibility -\n/// for example, do not use the non-contrast safe version for text.\n///\n/// @return {Colour} Representation of colour for organisation\n/// @throw if `$organisation` is not a known organisation\n/// @access public\n\n@function govuk-organisation-colour($organisation, $websafe: null, $contrast-safe: true) {\n // Check if the $organisation exists in the aliases map. If so, change the\n // value of $organisation to the aliased value.\n @if map-has-key($_govuk_colours-organisations-aliases, $organisation) {\n $organisation: map-get($_govuk_colours-organisations-aliases, $organisation);\n }\n\n // Check to see if the organisation exists\n @if not map-has-key($govuk-colours-organisations, $organisation) {\n @error \"Unknown organisation `#{$organisation}`\";\n }\n\n // Output a warning if $websafe is set.\n @if $websafe and not index($govuk-suppressed-warnings, \"organisation-colour-websafe-param\") {\n @warn _warning-text(\"organisation-colour-websafe-param\",\n \"The `$websafe` parameter of `govuk-organisation-colour` has been \" +\n \"renamed to `$contrast-safe`. The old parameter name will be removed in \" +\n \"the next major version.\"\n );\n }\n\n $org-colour: map-get($govuk-colours-organisations, $organisation);\n\n @if map-has-key($org-colour, deprecation-message) and not index($govuk-suppressed-warnings, \"organisation-colours\") {\n @warn _warning-text(\n \"organisation-colours\",\n map-get($org-colour, deprecation-message)\n );\n }\n\n // If the $websafe parameter is being used (it has been explicitly set as true\n // or false), assume the user hasn't updated to use $contrast-safe yet and map\n // the old parameter's value onto the new parameter.\n @if type-of($websafe) != \"null\" {\n $contrast-safe: $websafe;\n }\n\n // Determine the contrast-safe key to use depending on whether it's the new\n // palette or the legacy palette\n $safe-key: if($govuk-new-organisation-colours, \"contrast-safe\", \"colour-websafe\");\n\n @if $contrast-safe and map-has-key($org-colour, $safe-key) {\n @return map-get($org-colour, $safe-key);\n } @else {\n @return map-get($org-colour, colour);\n }\n}\n\n/// Make a colour darker by mixing it with black\n///\n/// @param {Colour} $colour - colour to shade\n/// @param {Number} $percentage - percentage of black to mix with $colour\n/// @return {Colour}\n/// @access public\n\n@function govuk-shade($colour, $percentage) {\n @return mix(#000000, $colour, $percentage);\n}\n\n/// Make a colour lighter by mixing it with white\n///\n/// @param {Colour} $colour - colour to tint\n/// @param {Number} $percentage - percentage of white to mix with $colour\n/// @return {Colour}\n/// @access public\n\n@function govuk-tint($colour, $percentage) {\n @return mix(govuk-colour(\"white\"), $colour, $percentage);\n}\n"]}