You are currently viewing the gmlscripts.pro static mirror. Forum access and script submissions are not available through this mirror.

Invert gmlscripts.pro

color_mix

NOTE: As inline code this is three times as fast as Game Maker's more flexible merge_color() function. However, due to unavoidable overhead, it is significantly slower when used as a script. In most cases, merge_color() is the better option and this script is presented here mainly for educational purposes.

color_mix(color1,color2)
Returns a 50/50 mixture of the two given colors.
COPY/// color_mix(color1,color2)
//
//  Returns a 50/50 mixture of the two given colors.
//
//      color1      RGB color, real
//      color2      RGB color, real
//
/// gmlscripts.pro/license
{
    return (argument0 & $fefefe) + (argument1 & $fefefe) >> 1;
}

Contributors: xot

GitHub: View · Commits · Blame · Raw