(quick question) How do i change a sprite's color without changing the outline?

Godot Version 4.4.1

Question

So i am making a game and i want to add customizable hair. I know i don’t have to make every color a frame in my spritesheet. I heard there’s like a pallete thing? but i don’t know how to access that via code or just in the view window (i don’t know how it’s called). also i would want to be able to change all the colours for highlights/shadows. Please help me, and thank you if you will.

Try this: Palette Swap (no recolor / recolor) - Godot Shaders

2 Likes

For color, I can think of 4 main methods to change it:

  1. Change it before you import it to godot
  2. Use the CanvasItem > Visibility > Modulate value to adjust the color. This tends to work best on white assets intended to set their value to the modulate value.
  3. Change the material using either a canvas material or a shader material. CanvasItem > Material > Material. This gives you some flexibility and the shader material can do a lot if you know what you’re doing.
  4. Add lighting. I don’t think this makes sense in your case.

For you, I think looking at color swap shaders on https://godotshaders.com/ would be a good place to start. You can then use the shader to place into the shader material mentioned above.

1 Like

i think this would work! although i am not using pixel art but the colors of my sprite are pretty flat so i think this can work!