// scss-docs-start color-functions
// Tint a color: mix a color with white
@function tint-color($color, $weight) {
  @return mix($white, $color, $weight);
}

// Shade a color: mix a color with black
@function shade-color($color, $weight) {
  @return mix($dark-black, $color, $weight);
}

// Shade the color if the weight is positive, else tint it
@function shift-color($color, $weight) {
  @return if($weight > 0, shade-color($color, $weight), tint-color($color, -$weight));
}
// scss-docs-end color-functions

// scss-docs-start line-height-resolver
// a resolver to resolve the relation between font-size and it is line height
@function resolve-line-height-scale($font-size) {
  @if $font-size == 10px {
    @return 2;
  } @else if $font-size == 12px or $font-size == 14px {
    @return 1.8;
  } @else if $font-size == 16px {
    @return 1.6;
  } @else if $font-size == 18px {
    @return 1.5;
  } @else if $font-size == 28px {
    @return 1.3;
  } @else if $font-size >= 48px and $font-size <= 80px {
    @return 1.3;
  }
}
// scss-docs-end line-height-resolver

// scss-docs-start math

// add
@function add($operand1, $operand2) {
  @return calc(#{$operand1} + #{$operand2});
}

// subtract
@function subtract($operand1, $operand2) {
  @return calc(#{$operand1} - #{$operand2});
}

// multiple
@function multiple($operand1, $operand2) {
  @return calc(#{$operand1} * #{$operand2});
}

// divide
@function div($operand1, $operand2) {
  @return calc(#{$operand1} / #{$operand2});
}
// scss-docs-end math


@function isDark($color){
  $r: red($color);
  $g: green($color);
  $b: blue($color);
  $yip: ($r * 299 + $g * 587 + $b * 144) / 1000;
  @return $yip < 128;
}
