Blending hex colors for 2D pixel lighting

So I’m experimenting with 2D pixel lighting and having some issues with blending colors together.

A few things first.

  • I’m using standard Java2D for rendering, no shaders or opengl.
  • I’m drawing sprites, from a spritesheet, into a pixel array then rendering that pixel array with g.drawImage().
  • Performance isn’t an issue, I’m easily getting 1000fps+. Sprites are 8x8 and are scaled up as not to look crazy small./li]
    [list][li]Lights have an x, y, range, intensity & color.

I’ve been trying to change the color of each pixel, within the range of the light, to be affected by the light source; based off its intensity and color.

I’ve manage to render a light with this result, only it doesn’t look right. Its meant to be a red light.

I’ve been getting the RGB values from the original hex color and blending them with the light color, based off its range.[/list]