@function primary-color() {
  @return map-get($color-palette, 'primary');
}

@function accent-color() {
  @return map-get($color-palette, 'accent');
}

@function gray($what-gray) {
  @return map-get($gray-palette, '#{$what-gray}-gray');
}

@function system-color($color-message) {
  @return map-get($system-palette, $color-message);
}

@function almost-white($color) {
  @return mix($color, #fff, 5%);
}

@function almost-black($color) {
  @return mix($color, #000, 20%);
}

@function space($size) {
  @return $space-unit * map-get($spaces, $size);
}

@function contrast-color($color) {
  $color-brightness: round((red($color) * 299) + (green($color) * 587) + (blue($color) * 114) / 1000);
  $light-color: round((red(#ffffff) * 299) + (green(#ffffff) * 587) + (blue(#ffffff) * 114) / 1000);

  @if abs($color-brightness) < ($light-color/2){
    @return $font-white-color;
  }

  @else {
    @return $font-color;
  }
}

@function text-inputs() {
  $val: ();

  $all-types: (
    text
    password
    date
    datetime
    datetime-local
    month
    week
    email
    number
    search
    tel
    time
    url
    color
  );

  @each $type in $all-types {
    $val: append($val, unquote('input[type=\'#{$type}\']'), comma);
  }

  @return $val;
}


