Here you can find the source of multiply(int colorA, int colorB)
public static int multiply(int colorA, int colorB)
//package com.java2s; //License from project: Open Source License public class Main { public static int multiply(int colorA, int colorB) { return makeColor(getAlphaF(colorA), getRedF(colorA) * getRedF(colorB), getGreenF(colorA) * getGreenF(colorB), getBlueF(colorA) * getBlueF(colorB)); }/* w w w . ja va 2 s . co m*/ public static int makeColor(float alpha, float red, float green, float blue) { return ((int) (alpha * 255) << 24) | ((int) (red * 255) << 16) | ((int) (green * 255) << 8) | (int) (blue * 255); } public static float getAlphaF(int col) { return (float) ((col & 0xff000000) >> 24) / 255; } public static float getRedF(int col) { return (float) ((col & 0x00ff0000) >> 16) / 255; } public static float getGreenF(int col) { return (float) ((col & 0x0000ff00) >> 8) / 255; } public static float getBlueF(int col) { return (float) (col & 0x000000ff) / 255; } }