Layer blend mode color problem

Is there anyone knows how to make a layer blending mode color? I know there is some internal method in actionscript 3.0 for blending mode like screen, hardlight, invert, etc. But for color I think it’s must be done manually. In some resource in internet (or in photoshop definition) it told that: color mode result image is the combination of luminosity of base color with the hue and saturation of blend color. I try using method to convert RGBtoHSL and HSL toRGB process per pixel but the result is not satisfied due the amount of time to process it. Is there any other way to do this?:sigh: