@import 'palette';
$dark-disabled-text: rgba(black, 0.38);
$default-primary: (
  default: $oui-blue,
  lighter: lighten($oui-blue, 10%),
  darker: $oui-darker-blue,
  default-contrast: $oui-white,
);

$default-accent: (
  default: $oui-green,
  lighter: lighten($oui-green, 10%),
  darker: darken($oui-green, 10%),
  default-contrast: $oui-white,
);

$default-warn: (
  default: $oui-warn,
  lighter: lighten($oui-warn, 10%),
  darker: darken($oui-warn, 10%),
  default-contrast: $oui-white,
);

$default-background: (
  background: $oui-white,
  disabled-button: #c8c8c8,
  disabled-button-border: $oui-disabled-grey,
);

$default-foreground: (
  base: black,
  disabled-link-button: $oui-disabled-grey,
  disabled-ghost-button: $oui-disabled-grey,
  disabled-button: #ffffff,
  text: #333333,
  hint-text: rgba(black, 0.38),
  divider: rgba(black, 0.12),
  disabled-text: $oui-disabled-grey,
  secondary-text: #666666,
  hover: rgba(0, 0, 0, 0.04),
);
@function oui-palette(
  $base,
  $lighter: null,
  $darker: null,
  $contrast: $oui-white
) {
  @return (
    default: $base,
    lighter: if($lighter, $lighter, lighten($base, 10%)),
    darker: if($darker, $darker, darken($base, 10%)),
    default-contrast: $contrast
  );
}
@function oui-theme(
  $primary: (),
  $accent: (),
  $warn: (),
  $foreground: (),
  $background: ()
) {
  @return (
    primary: map-merge($default-primary, $primary),
    accent: map-merge($default-accent, $accent),
    warn: map-merge($default-warn, $warn),
    foreground: map-merge($default-foreground, $foreground),
    background: map-merge($default-background, $background)
  );
}
// Gets a color from a theme palette (the output of oui-palette).
// The hue can be one of the standard values (500, A400, etc.), one of the three preconfigured
// hues (default, lighter, darker), or any of the aforementioned prefixed with "-contrast".
// @param $color-map The theme palette (output of oui-palette).
// @param $hue The hue from the palette to use. If this is a value between 0 and 1, it will
// be treated as opacity.
// @param $opacity The alpha channel value for the color.
@function oui-color($palette, $hue: default, $opacity: null) {
  // If hueKey is a number between zero and one, then it actually contains an // opacity value, so recall this function with the default hue and that given opacity.
  @if type-of($hue) == number and $hue >= 0 and $hue <= 1 {
    @return oui-color($palette, default, $hue);
  }
  $color: map-get($palette, $hue);
  $opacity: if($opacity == null, opacity($color), $opacity);
  @return rgba($color, $opacity);
}
