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

$base_color: if($variant == 'light', #ffffff, lighten(desaturate($jet, 20%), 10%));
$bg_color: if($variant == 'light', #FAFAFA, lighten($inkstone, 0.5%));
$fg_color: if($variant == 'light', $inkstone, $porcelain);

$selected_fg_color: $primary_accent_fg_color;
$selected_bg_color: if($variant == 'light', $primary_accent_bg_color, darken($primary_accent_bg_color, 4%));
$selected_borders_color: if($variant== 'light', darken($selected_bg_color, 15%), darken($selected_bg_color, 30%));
$borders_color: if($variant == 'light', darken($bg_color, 20%), darken($bg_color, 11%));
$alt_borders_color: if($variant == 'light', darken($bg_color, 24%), darken($bg_color, 10%));
$borders_edge: if($variant == 'light', transparentize(white, 0.2), transparentize($fg_color, 0.93));
$link_color: if($variant == 'light', $linkblue, $blue);
$link_visited_color: if($variant == 'light', darken($link_color, 20%), lighten($link_color, 10%));
$top_hilight: $borders_edge;
$dark_fill: mix($borders_color, $bg_color, 50%);

$warning_color: $yellow;
$error_color: $red;
$success_color: lighten($green, 5%);
$destructive_color: if($variant == 'light', $red, darken($red, 10%));

$osd_fg_color: #eeeeec;
$osd_text_color: white;
$osd_bg_color: transparentize(lighten($jet, 2%),0.025);
$osd_insensitive_bg_color: transparentize(mix($osd_fg_color, opacify($osd_bg_color, 1), 10%), 0.5);
$osd_insensitive_fg_color: mix($osd_fg_color, opacify($osd_bg_color, 1), 50%);
$osd_borders_color: transparentize(black, 0.3);
$osd_outer_borders_color: transparentize(white, 0.84);

$tooltip_borders_color: $osd_outer_borders_color;
$shadow_color: transparentize(black, 0.9);

//insensitive state derived colors
$insensitive_fg_color: mix($fg_color, $bg_color, 50%);
$insensitive_bg_color: mix($bg_color, $base_color, 60%);
$insensitive_borders_color: $borders_color;

//colors for the backdrop state, derived from the main colors.
$backdrop_base_color: if($variant =='light', darken($base_color,1%), lighten($base_color,1%));
$backdrop_bg_color: $bg_color;
$backdrop_fg_color: mix($fg_color, $backdrop_bg_color, 80%);
$backdrop_insensitive_color: if($variant =='light', darken($backdrop_bg_color,15%), lighten($backdrop_bg_color,15%));
$backdrop_borders_color: mix($borders_color, $bg_color, 90%);
$backdrop_dark_fill: mix($backdrop_borders_color,$backdrop_bg_color, 35%);

$base_hover_color: transparentize(white, 0.8);
$base_active_color: transparentize(white, 0.75);
$hover_fg_color: lighten($selected_fg_color, .25);
$active_fg_color: transparentize($selected_fg_color, .5);

$panel_bg_color: lighten($jet, 2%);
$panel_fg_color: darken($porcelain, 2%);
$dash_bg_color: $panel_bg_color;
$panel-alpha-value: 0.6;
$panel_opaque_value: 0.0;

$dash-alpha-value: 0.6;
$dash-opaque-alpha-value: 0.0;

//special cased widget colors
$suggested_bg_color: if($variant == 'light', lighten($green, 5%), darken($green, 5%));
$suggested_border_color: if($variant=='light', darken($suggested_bg_color, 5%), darken($suggested_bg_color, 10%));
$progress_bg_color: $secondary_accent_bg_color;
$progress_border_color: if($variant== 'light', darken($progress_bg_color, 5%), darken($borders_color, 5%));
$checkradio_bg_color: if($variant=='light', $secondary_accent_bg_color, darken($secondary_accent_bg_color, 8%));
$checkradio_fg_color: $secondary_accent_fg_color;
$switch_bg_color: if($variant=='light', $secondary_accent_bg_color, darken($secondary_accent_bg_color, 8%));
$switch_border_color: if($variant=='light', darken($secondary_accent_bg_color, 15%), darken($borders_color, 5%));
$focus_border_color: lighten($primary_accent_bg_color, 14%);
