//
// Generic drawing related bits
//

@function _widget_edge($c:$borders_edge)
{
    // Outer highlight "used" on most widgets
    //
    @if $c == none { @return none; }
    @else { @return 0 1px $c; }
}

@mixin _shadows($list...)
{
    // Helper mixin to stack up to box-shadows;
    //
    $shadows: null;

    @each $shadow in $list
    {
        @if $shadow != none
        {
            $shadows: $shadows, $shadow;
        }
    }

    box-shadow: $shadows;
}

@function _border_color($c, $darker: false)
{
    @if $darker == true
    {
        @return darken($c, 20%);
    }
    @else
    {
        @return darken($c, 10%);
    }
}

@function _text_shadow_color($tc:$fg_color, $bg:$bg_color)
{
    //
    // Calculate the color of text shadows
    //
    // $tc is the text color
    // $bg is the background color
    //
    $_lbg: lightness($bg) / 100%;

    @if lightness($tc) < 50%
    {
        @return transparentize(#FFFFFF, 1 - $_lbg / ($_lbg * 1.3));
    }
    @else
    {
        @return transparentize(#000000, $_lbg * 0.8);
    }
}
