Shader to colorize an image to red and yellow

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
kingomar
Prole
Posts: 37
Joined: Mon Mar 17, 2014 8:01 pm

Shader to colorize an image to red and yellow

Post by kingomar »

Hello Everyone!
I'm looking to change the image color to give it a Yellow accent or red accent.. i can easily implement an image and replace the background but i want to do so with an Animation. like slowly transform the colors to yellow and red..
What's the shader i need? and can use tween to slowly change the colors of the image? Thank you!
Check out my game:
- Youtube Video : http://goo.gl/91x6dT
- Download Link : http://goo.gl/6llhmp
User avatar
Plu
Inner party member
Posts: 722
Joined: Fri Mar 15, 2013 9:36 pm

Re: Shader to colorize an image to red and yellow

Post by Plu »

Do you mean you want to change the whole image to slowly become yellow, or to tint the whole thing yellow? Because you can do both without a shader; the first by drawing a yellow rectangle over the image that slowly fills up with Alpha and the second by using graphics.setColor.
User avatar
kingomar
Prole
Posts: 37
Joined: Mon Mar 17, 2014 8:01 pm

Re: Shader to colorize an image to red and yellow

Post by kingomar »

I want to make the image displayed Yellow. not making the whole background yellow... How can i tween( using tween library ) the values? Thanks
Check out my game:
- Youtube Video : http://goo.gl/91x6dT
- Download Link : http://goo.gl/6llhmp
User avatar
Ratchet
Citizen
Posts: 67
Joined: Mon Apr 08, 2013 10:32 am

Re: Shader to colorize an image to red and yellow

Post by Ratchet »

You don't need a shader for this. Just set the color to yellow before drawing it:

Code: Select all

love.graphics.setColor(255, 255, 0)
love.graphics.draw(myImage, 100, 100)

-- don't forget to set the color back to white or else all draw operations after it will appear yellow
love.graphics.setColor(255, 255, 255)
macOS 10.14 Mojave | LÖVE 11.2
Post Reply

Who is online

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