Hi, I'm making my game and I need to change the color of my sprite.
I'm testing in this page modified the huv and replace for another color, and work well
https://www.imgonline.com.ua/eng/replace-color.php
But I need to get the same result or similar dynamically ingame.
I'm search in the wiki and found about HSV but I'm new with shaders and no understand about it.
https://love2d.org/wiki/HSV_color
Sprite :
Imgonline's output:
Update : Using a simple code I can change the color, but not that I choose.
[SOLVED]Change color of sprite with shader.
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Change color of sprite with shader.
You need to convert pixel color to HSV values. Then you modify these values as appropriate, such as by setting desired hue. Then you convert HSV back to RGB and that's your output pixel color.
Re: Change color of sprite with shader.
Thanks man, this is that I needed.
Searching in the forum I look this function
https://love2d.org/forums/viewtopic.php?p=38739#p38739
And work fine for me.
- Attachments
-
- game.love
- (143.11 KiB) Downloaded 201 times
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 3 guests