@import "~bootstrap/scss/functions";

// Color contrast
@function color-yiq($color, $dark: $yiq-text-dark, $light: $yiq-text-light) {
  @if ($color == --alert) {
    @return $dark;
  } @else if $color == --light {
    @return $dark;
  } @else {
    @return $light;
  }
}

// Request a theme color level
@function theme-color-level($color-name: "primary", $level: 0) {
  $color: theme-color($color-name);
  //$color-base: if($level > 0, $black, $white);
  //$level: abs($level);

  @return $color;
}

@function darken-color($color, $level) {
  @return hsl(var(#{$color}-color-h), var(#{$color}-color-s), calc(var(#{$color}-color-l) - #{$level}));
}

@function lighten-color($color, $level) {
  @return hsl(var(#{$color}-color-h), var(#{$color}-color-s), calc(var(#{$color}-color-l) + #{$level}));
}

@function set-opacity($color, $opacity) {
  @return hsla(var(#{$color}-color-h), var(#{$color}-color-s), var(#{$color}-color-l), #{$opacity});
}

@function normal-color($color) {
  @return var(#{$color}-color);
}

@function variant-color($color) {
  @return var(#{$color}-variant-color);
}

@function hover-color($color) {
  @return var(#{$color}-hover-color);
}

@function active-color($color) {
  @return var(#{$color}-active-color);
}

@function focused-color($color) {
  @return var(#{$color}-focused-color);
}

@function disabled-color($color) {
  @return var(#{$color}-disabled-color);
}
