// When color definition differs for dark and light variant,
// it gets @if ed depending on $variant

@import 'color-palette';

@function fade($c) {
  @return mix($c, $grey_900, 50%);
}

// Foreground colors
$dark_fg_color:   rgba($black, 0.87);
$light_fg_color:  $white;
$button_fg_color: if($variant == 'light', rgba($black, 0.62), rgba($white, 0.8)); // extra fg color for raised buttons

$fg_color:                    if($variant == 'light', rgba($black, 0.87), rgba($white, 0.9));
$secondary_fg_color:          if($variant == 'light', rgba($black, 0.54), rgba($white, 0.7));
$hint_fg_color:               if($variant == 'light', rgba($black, 0.38), rgba($white, 0.5));
$disabled_fg_color:           if($variant == 'light', rgba($black, 0.38), rgba($white, 0.5));
$disabled_secondary_fg_color: if($variant == 'light', rgba($black, 0.26), rgba($white, 0.3));
$track_color:                 if($variant == 'light', rgba($black, 0.2), rgba($white, 0.1));
$visit_color:                 if($variant == 'light', rgba($black, 0.16), rgba($white, 0.08));
$divider_color:               if($variant == 'light', rgba($black, 0.12), rgba($white, 0.06));

$titlebar_fg_color:                    if($panel == 'light', rgba($black, 0.87), $white);
$titlebar_secondary_fg_color:          if($panel == 'light', rgba($black, 0.54), rgba($white, 0.7));
$titlebar_hint_fg_color:               if($panel == 'light', rgba($black, 0.38), rgba($white, 0.5));
$titlebar_disabled_fg_color:           if($panel == 'light', rgba($black, 0.38), rgba($white, 0.5));
$titlebar_disabled_secondary_fg_color: if($panel == 'light', rgba($black, 0.26), rgba($white, 0.3));
$titlebar_track_color:                 if($panel == 'light', rgba($black, 0.26), rgba($white, 0.1));
$titlebar_divider_color:               if($panel == 'light', rgba($black, 0.12), rgba($white, 0.06));

$inverse_fg_color:                    rgba($white, 0.85);
$inverse_secondary_fg_color:          rgba($white, 0.7);
$inverse_hint_fg_color:               rgba($white, 0.5);
$inverse_disabled_fg_color:           rgba($white, 0.5);
$inverse_disabled_secondary_fg_color: rgba($white, 0.3);
$inverse_track_color:                 rgba($white, 0.3);
$inverse_divider_color:               rgba($white, 0.15);

// Background colors
$base_color:     if($variant =='dark', #242424, #ffffff);
$alt_base_color: if($variant =='dark', lighten($base_color, 25%), darken($base_color, 25%));

$bg_color:         rgba($black, $middle_opacity);
$alt_bg_color:     rgba($black, $lower_opacity);
$inverse_bg_color: rgba($inverse_fg_color, 0.13);
$keyboard_bg_color:  if($variant == 'light', $grey_50, fade($grey_700)); // for gnome-shell keyboard
$alt_keyboard_bg_color:  if($variant == 'light', $grey_300, fade($grey_900)); // for gnome-shell keyboard

// Misc colors

$primary_color: if($variant == 'light', #0046DB, #0046DB);
$alt_primary_color: if($variant == 'light', #0e6bff, #0062FF);
$accent_color: if($variant == 'light', #0e6bff, #0062FF);

$panel_bg: if($variant == 'light', #f5f5f5, #2a2a2a);
$panel_bg_color: if($trans == 'true', rgba($panel_bg, 0.65), $panel_bg);
$panel_fg_color: if($panel == 'dark', #dedede, #242424);
$menu_bg_color: if($trans == 'true', rgba($base_color, 0.95), $base_color);

$link_color:         $primary_color;
$visited_link_color: $purple_A200;

$warning_color: $orange_A700;
$error_color:   $deep_orange_A700;
$success_color: $green_A700;

$suggested_color:   $accent_color;
$destructive_color: $red_A200;

$info_bg_color:     $green_400;
$question_bg_color: $blue_400;
$warning_bg_color:  $orange_400;
$error_bg_color:    $red_400;

$border_color:        if($variant == 'light', rgba($black, 0.12), rgba($white, 0.12));
$highlight_color:     if($variant == 'light', rgba($white, 0.4),  rgba($white, 0.1));
$alt_highlight_color: rgba($white, 0.2);
