@import '~csscolors';

@function veracity-color ($color, $variant: "default") {
  $map: $veracity-colors;
  @if map-has-key($map, $color) {
    $value: map-get($map, $color);
    @if (type-of($value) == 'map') {
      @if map-has-key($value, $variant) {
        @return map-get($value, $variant);
      }
      @error "Cannot find variant '#{$variant}' of '#{$color}' in veracity-colors.";
      @return null;
    }
    @else {
      @return $value;
    }
  }
  @error "The color '#{$color}' is not available in veracity-colors.";
  @return null;
}



// -----------------------------------------------------------------------------
//  COLOR SETTINGS
// -----------------------------------------------------------------------------
//
//  These color variables are based on the DNVGL color palette, and are used to
//  specify more precise color tokens for specific usages.

$dnvgl-colors: (

  // PRIMARY COLORS
  cyan:                #009fda,
  dark-blue:           #0f204b,
  land-green:          #36842d,
  sea-blue:            #003591,
  digital-blue:        #0067c5,
  primary-white:       #fff,
  primary-black:       #000,

  // SUPPORTING COLORS
  orange:              #e98300,
  yellow:              #fecb00,
  violet:              #6e5091,
  red:                 #c4262e,
  warm-grey:           #988f86,

  // CYAN TINTS
  sky-blue-lightest:   #e5f5fb,
  sky-blue-light:      #ccecf8,
  sky-blue:            #99d9f0,
  cyan-lightest:       #66c5e9,
  cyan-light:          #33b2e1,
  // cyan:             #009fda,  // Already declared
  cyan-dark:           #005e80,

  // DARK BLUE TINTS
  dark-blue-lightest:  #ced5e6,
  dark-blue-light:     #24365c,
  // dark-blue:        #0f204b,  // Already declared
  dark-blue-dark:      #0b1838,
  dark-blue-darkest:   #09122b,

  // LAND GREEN TINTS
  land-green-lightest: #bae6b0,
  land-green-light:    #4f9946,
  // land-green:       #36842d,  // Already declared
  land-green-dark:     #307528,
  land-green-darkest:  #276121,

  // SEA BLUE TINTS
  sea-blue-lightest:   #b7c9ea,
  sea-blue-light:      #1f51a8,
  // sea-blue:         #003591,  // Already declared
  sea-blue-dark:       #002d7a,
  sea-blue-darkest:    #002669,

  // NEUTRAL SCALE
  neutral-02:          #f9f9f9,
  neutral-05:          #f2f2f2,
  neutral-10:          #e5e5e5,
  neutral-20:          #ccc,
  neutral-40:          #999,
  neutral-60:          #666,
  neutral-80:          #333,

  // ORANGE TINTS
  orange-lightest:     #f7cf99,
  orange-light:        #ed9d34,
  // orange:           #e98300,  // Already declared
  orange-dark:         #d97700,
  orange-darkest:      #8a4c00,

  // YELLOW TINTS
  yellow-lightest:     #ffeca0,
  yellow-light:        #ffd83a,
  // yellow:           #fecb00,  // Already declared
  yellow-dark:         #edbe00,
  yellow-darkest:      #806600,

  // VIOLET TINTS
  violet-lightest:     #b8a8ca,
  violet-light:        #8369a1,
  // violet:           #6e5091,  // Already declared
  violet-dark:         #5d437a,
  violet-darkest:      #4d3866,

  // RED TINTS
  red-lightest:        #ffc5c7,
  red-light:           #cc4148,
  // red:              #c4262e,  // Already declared
  red-dark:            #ad2128,
  red-darkest:         #941c22,

  // WARM GREY TINTS
  warm-grey-lightest:  #ccc7c2,
  warm-grey-light:     #a8a099,
  // warm-grey:        #988f86,  // Already declared
  warm-grey-dark:      #807870,
  warm-grey-darkest:   #56524d

);

// -----------------------------------------------------------------------------

@function base-color($color) {
  @return map-get($dnvgl-colors, $color);
}

// -----------------------------------------------------------------------------

// TODO: Investigate these .. Not in use?

// FEEDBACK COLORS
$success:       #3f9c35; // TODO: New color - investigate
$warning:       base-color(yellow);
$error:         base-color(red);
$informational: base-color(sea-blue);

// -----------------------------------------------------------------------------

// ELEMENT COLORS
$link-color: base-color(sea-blue);

$color_header:base-color(dark-blue); //Used for headings and logo
$color_anchor_foreground:base-color(dark-blue); //Used for links

$color_border_dark:base-color(dark-blue);
$color_border_light:base-color(neutral-05);
$color_background_content:base-color(neutral-10); //Used for accentuated background such as the footer

$color_highlighted_content:base-color(sky-blue);

$color_inverted_background:base-color(sea-blue);
$color_inverted_foreground:base-color(primary-white);
$color_inverted_highlighted:base-color(dark-blue);
// -----------------------------------------------------------------------------
