
$yiq-contrasted-threshold: 150 !default;

// Customize the light and dark text colors for use in our YIQ color contrast function.
$yiq-text-dark: $gray-900 !default;
$yiq-text-light: $white !default;

/**
 * YIQ color contrast function
 * $color: Acceptable values are between 0 and 255.
 */
@function color-yiq($color) {
    $r: red($color);
    $g: green($color);
    $b: blue($color);

    $yiq: (($r * 299) + ($g * 587) + ($b * 114)) / 1000;

    @if ($yiq >=$yiq-contrasted-threshold) {
        @return $yiq-text-dark;
    }

    @else {
        @return $yiq-text-light;
    }
}