/******************************************************************
Site Name:
Author:

Stylesheet: Colors Stylesheet

******************************************************************/



$pink: ((#000,0), (#b3167a,40), (#e52387,50), (#ee529c,60), (white,100));
$purple: ((#000,0), (#613e7f,30), (#8356aa,40), (#9773b8,50), (#d2cbe0,80), (#e8e8ef,90), (white,100));
$warm: ((#000,0), (#b22b26,40), (#df3d21,50), (#f37121,60), (#fba919,70), (#fec82d,80), (#FFE766,90), (white,100));
$greywarm: ((#000,0), (#2E170A,10), (#4b2e13,20), (#67472b,30), (#826042,40), (#9e795a,50), (#b49578,60), (#C8AF94,70), (#ddcab1,80), (#f2e5ce,90), (white,100));
$greycool: ((#000,0), (#071b36,10), (#0e3454,20), (#27506c,30), (#3f6b84,40), (#57869b,50), (#759fb0,60), (#93b9c4,70), (#b1d3d9,80), (#ceebed,90), (white,100));
$cool: ((#000,0), (#00134f,10), (#013160,20), (#074e7f,30), (#0069aa,40), (#0085bf,50), (#00a2d5,60), (#00beea,70), (#4ad7f5,80), (#a0f0f9,90), (white,100));
$green: ((#000,0), (#668738,50), (#78aa2f,60), (#92c143,70), (#add858,80), (#d8ecaf,90), (white,100));

@function hueno($L: 50, $S: 100, $grad: $warm){

  @if $L < 0 { $L: 0; }
  @if $L > 100 { $L: 100; }
  @if $S < 0 { $S: 0; }
  @if $S > 100 { $S: 100; }

  // @if length($grad) < 2 { @return #000000}

  $greyVal: rgb(2.55 * $L, 2.55 * $L, 2.55 * $L);
  $a: (0,1000);
  $b: (0,1000);
    

  @for $i from 1 through length($grad){

    $stop: nth($grad, $i);
    $diff: abs( $L - nth($stop, 2) );

    @if $diff == 0 {
      $a: (nth($stop, 1), $diff);
      $b: (nth($stop, 1), $diff);
    }

    @if $diff <= nth($a, 2)
      {
        $b: $a;
        $a: (nth($stop, 1), $diff);
      } 
    @else if $diff <= nth($b, 2)
      {
        $b: (nth($stop, 1), $diff);
      }
  }

  $range: nth($a, 2) + nth($b, 2);
  @if $range == 0 {$range:1}
  $mainC: mix(
    nth($a, 1), 
    nth($b, 1), 
    nth($b, 2) / $range * 100 
  );
  $outC: mix($mainC, $greyVal, $S);

  @if $grad == $warm{
    $muted: hueno($L, $S, $greywarm);
    @if $S > 50 {@return mix($mainC, $muted, ($S - 50) * 2)}
    @else {@return mix($muted, $greyVal, $S*2)}
  }

  @if $grad == $cool{
    $muted: hueno($L, $S, $greycool);
    @if $S > 50 {@return mix($mainC, $muted, ($S - 50) * 2)}
    @else {@return mix($muted, $greyVal, $S*2)}
  }


  @return $outC;
}

  @function clamp($value, $min, $max) {
  @return if($value > $max, $max, if($value < $min, $min, $value));
}


$alert-yellow:      hueno(90, 100, $warm);
$alert-red:         hueno(50, 100, $warm);
$alert-green:       hueno(70, 100, $green);
$alert-blue:        hueno(60, 100, $cool);

$black:             #323944;
$white:             #fff;

$light-gray:        #f8f9fa;
$gray:              #eaedf2;
$text-color:        #5c6b80;
$meta-gray:         #9fa6b4;

$tan:               hueno(90, 100, $greywarm);


$bones-pink:        hueno(65, 100, $pink);
$blue:              hueno(65, 100, $cool);

$link-color:        hueno(65, 100, $cool);
$link-hover:        hueno(55, 100, $cool);

$border-color:      #ccc;
$disabled-gray:     #cfcfcf;






