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

Invert gmlscripts.pro

color_multiply

color_multiply(color1,color2)
Returns the product of the two given colors.
COPY
  1. /// color_multiply(color1,color2)
  2. //
  3. // Returns the product of the two given colors.
  4. //
  5. // color1 RGB color, real
  6. // color2 RGB color, real
  7. //
  8. /// gmlscripts.pro/license
  9. {
  10. var c1,c2,t;
  11. c1 = argument0;
  12. c2 = argument1;
  13. t = ((c1 & 255) * (c2 & 255)) >> 8;
  14. c1 = c1 >> 8;
  15. c2 = c2 >> 8;
  16. t |= ((c1 & 255) * (c2 & 255)) & 65280;
  17. c1 = c1 & 65280;
  18. c2 = c2 >> 8;
  19. t |= ((c1 * c2) & 16711680);
  20. return t;
  21. }

Contributors: xot

GitHub: View · Commits · Blame · Raw