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.com/license
{
return (argument0 & $fefefe) + (argument1 & $fefefe) >> 1;
}
Contributors: xot
GitHub: View · Commits · Blame · Raw