
var curr_color_r = 0;
var curr_color_g = 0;
var curr_color_b = 0;
//var curr_color_a = 0;

var curr_color_bg_r = 255;
var curr_color_bg_g = 255;
var curr_color_bg_b = 255;

var darker_supported = RegExp(" AppleWebKit/").test(navigator.userAgent);

var curr_line_width = 1;
var curr_opacity = 1;
var curr_composite_op = "source-over";


function color_str( r, g, b, alpha )
{
    return "rgba(" + r + "," + g + "," + b + "," + alpha + ")";
}

function color_rnd_str_verb( r, g, b, alpha )
{
    return color_str( Math.round(Math.random() * r), Math.round(Math.random() * g), Math.round(Math.random() * b), alpha );
}

function color_rnd_str( alpha )
{
    return color_str( Math.floor(Math.random() * 255), Math.floor(Math.random() * 255), Math.floor(Math.random() * 255), alpha );
}

function curr_color_str( alpha )
{
    return color_str( curr_color_r, curr_color_g, curr_color_b, alpha );
}

function curr_color_inv_str( alpha )
{
    return color_str( 255-curr_color_r, 255-curr_color_g, 255-curr_color_b, alpha );
}

function curr_color_bg_str( alpha )
{
    return color_str( curr_color_bg_r, curr_color_bg_g, curr_color_bg_b, alpha );
}


