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

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

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

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

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

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

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

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

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

  @else {
    @return almost-black($ds-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;
}
