Colorizing black pixels

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
hryx
Party member
Posts: 110
Joined: Mon Mar 29, 2010 2:28 am
Location: SF<CA<USA

Colorizing black pixels

Post by hryx »

I'm balls deep in a graphic tile-based level with several layers à la Photoshop, which I'm porting to 0.9.0. All drawable tile objects contain only black, white, and alpha.

I used to be able to "colorize" the black pixels of the current layer with a slight green using setColorMode. It was kind of awkward and I didn't understand it, but it worked.

I'm having trouble doing this in 0.9.0, now that setColorMode is gone. I thought an additive blend mode would be able to lighten dark pixels, but right now additive is only making the layer's images disappear. Also note that I only want to affect the current layer, not those below or above.

Any advice? I'd rather not use shaders just for this.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Colorizing black pixels

Post by bartbes »

Additive should work, but if you only want it applied to that layer, you might need to do some canvas magic.
User avatar
hryx
Party member
Posts: 110
Joined: Mon Mar 29, 2010 2:28 am
Location: SF<CA<USA

Re: Colorizing black pixels

Post by hryx »

I could live with that, though it's too bad I'd have to introduce a hardware-dependent feature.

Still, it's curious I can't get additive to do anything right now. Exchanging "multiplicative" with "additive" in the wiki example code works, but not in my own app (which uses spritebatches rather than rectangle primitives).
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 4 guests