// Mixes a provided color with white.
@function tint($color, $percent) {
  @return mix(#fff, $color, $percent);
}

// Mixes a provided color with black.
@function shade($color, $percent) {
  @return mix(#000, $color, $percent);
}

// For theming. Checks the text color and tells us whether it's light or dark.
// Based on that we either tint or shade.
@function tintOrShade($color, $tint, $shade) {
  @if (lightness($euiTextColor) > 50) {
    @return shade($color, $shade);
  } @else {
    @return tint($color, $tint);
  }
}

@function shadeOrTint($color, $shade, $tint) {
  @if (lightness($euiTextColor) < 50) {
    @return shade($color, $shade);
  } @else {
    @return tint($color, $tint);
  }
}

// Core

$euiColorPrimary: #0079a5 !default;
$euiColorSecondary: #00A69B !default;
$euiColorAccent: #DD0A73 !default;
$euiColorHighlight: #FFFBF1 !default;
$euiColorGhost: #FFF !default;

// Status
$euiColorSuccess: $euiColorSecondary !default;
$euiColorDanger: #A30000 !default;
$euiColorWarning: #E5830E !default;

// Grays
$euiColorEmptyShade: #FFF !default;
$euiColorLightestShade: #F5F5F5 !default;
$euiColorLightShade: #D9D9D9 !default;
$euiColorMediumShade: #999 !default;
$euiColorDarkShade: #666 !default;
$euiColorDarkestShade: #3F3F3F !default;
$euiColorFullShade: #000 !default;

// Every color below must be based mathmatically on the set above.

$euiTextColor: $euiColorDarkestShade !default;
$euiTitleColor: $euiColorFullShade !default;
$euiLinkColor: $euiColorPrimary !default;
$euiFocusBackgroundColor: tintOrShade($euiColorPrimary, 90%, 50%) !default;

// Code

$euiCodeBlockBackgroundColor: $euiColorLightestShade !default;
$euiCodeBlockColor: $euiTextColor !default;
$euiCodeBlockSelectedBackgroundColor: inherit !default;
$euiCodeBlockCommentColor: #998 !default;
$euiCodeBlockSelectorTagColor: inherit !default;
$euiCodeBlockStringColor: #DD0A73 !default;
$euiCodeBlockNumberColor: #00A69B !default;
$euiCodeBlockKeywordColor: #333 !default;
$euiCodeBlockFunctionTitleColor: inherit !default;
$euiCodeBlockTagColor: #0079a5 !default;
$euiCodeBlockNameColor: inherit !default;
$euiCodeBlockTypeColor: #0079a5 !default;
$euiCodeBlockAttributeColor: inherit !default;
$euiCodeBlockSymbolColor: #990073 !default;
$euiCodeBlockParamsColor: inherit !default;
$euiCodeBlockMetaColor: #999 !default;
$euiCodeBlockTitleColor: #900 !default;
$euiCodeBlockRegexpColor: #009926 !default;
$euiCodeBlockBuiltInColor: #0086b3 !default;
$euiCodeBlockSectionColor: #ffc66d !default;
$euiCodeBlockAdditionBackgroundColor: #dfd !default;
$euiCodeBlockAdditionColor: inherit !default;
$euiCodeBlockDeletionBackgroundColor: #fdd !default;
$euiCodeBlockDeletionColor: inherit !default;
$euiCodeBlockSelectorClassColor: inherit !default;
$euiCodeBlockSelectorIdColor: inherit !default;
