<commit_before>@import "../variables/t-base";

@function yiq($color) {
  $r: red($color);
  $g: green($color);
  $b: blue($color);

  @return (($r * 299) + ($g * 587) + ($b * 114)) / 1000;
}

@function yiq-is-light($color, $threshold) {
  @return if (yiq($color), true, false);
}

@function yiq-contrast-color($color, $dark, $light, $threshold) {
  @return if(yiq-is-light($color, $threshold), $dark, $light);
}

//chooses the optimal color for good contrast.
@function yiq-contrasting-color($color, $light: $t-Color__text--light, $dark: $t-Color__text--dark) {
  $threshold: (yiq($light) + yiq($dark)) / 2;
  @if yiq-is-light($color, $threshold) {
    @return $dark;
  } @else {
    @return $light;
  }
}

@function hover-color($color, $hover-color: null) {
  @if $hover-color == null {<commit_msg>Fix color contrast functions<commit_after>@import "../variables/t-base";

@function yiq($color) {
  $r: red($color);
  $g: green($color);
  $b: blue($color);

  @return (($r * 299) + ($g * 587) + ($b * 114)) / 1000;
}

@function yiq-is-light($color, $threshold) {
  @return if(yiq($color) > $threshold, true, false);
}

//chooses the optimal color for good contrast.
@function yiq-contrasting-color($color, $light: $t-Color__text--light, $dark: $t-Color__text--dark) {
  $threshold: (yiq($light) + yiq($dark)) / 2;
  @return if(yiq-is-light($color, $threshold), $dark, $light);
}

@function hover-color($color, $hover-color: null) {
  @if $hover-color == null {
{'fraction_non_alphanumeric': 0.21986301369863015, 'fraction_numerical': 0.019178082191780823, 'mean_word_length': 4.274368231046932, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3312450', 'n_tokens_mistral': 582, 'n_tokens_neox': 552, 'n_words': 126}