Brush / BG/ Density

by tylerbrownhenry

JavaScript

var difference = function (a, b) { 
       var diff = Math.abs(a - b); 
    console.log(diff);
    return parseInt(diff * (settings.density + settings.opacity));


};

bg = 100; // Color that we are 'painting' over.
brush = 15; // Color of the brush that we are using.
settings = {};
settings.density = .2 // The area that is found when the brush hits a far edge
settings.opacity = .4 // The actual opacity of the brush

console.log(difference(bg,brush));



//if bg > brush ....
//newbg = (bg - difference);

//if bg < brush ....
//newbg = (bg + difference);