You are not logged in.
Pages: 1
/// merge_color_squared(col1,col2,amount);
//
// Returns a color merged from two colors by the specified amount. The values
// are squared to make a more natural blend.
//
// col1 the first color
// col2 the second color
// amount amount of blend, 0 - 1
//
//
/// GMLscripts.com/license
{
var _col1 = argument0;
var _col2 = argument1;
var _amount = argument2;
var _col;
_col[1,2] = colour_get_blue(_col2);
_col[1,1] = colour_get_green(_col2);
_col[1,0] = colour_get_red(_col2);
_col[0,2] = colour_get_blue(_col1);
_col[0,1] = colour_get_green(_col1);
_col[0,0] = colour_get_red(_col1);
for (var i=0;i<3;i++) {
_col[0,i] = sqrt(
lerp(
sqr(_col[0,i]),
sqr(_col[1,i]),
_amount
)
);
}
return make_colour_rgb(_col[0,0],_col[0,1],_col[0,2]);
}
Pages: 1