Changing hue doesn't do anything, though the sprite is coloured

Godot Version

4.2.1

Question

I have this coloured sprite to which I want to change a hue.
cube_107_2

In modulate property when I drag the hue slider the hue doesn’t change unless I’ve decreased a value on one of the RGB sliders.
Instead I want a behaviour like in photoshop which is shown in this video.

Why I need to tweak the hue.
I have a geometry dash game where the player (has the same sprite) leaves the trail of these sprites. The trail disappears with time and must change hue. It also should start with the same hue, but with time it should change the hue.
this code is responsible for trail:

extends Node2D
var trace = preload("res://trace_sprite.tscn")
var MyDelta

func _process(delta):
	MyDelta = delta



func _on_trace_sprite_timer_timeout():
	var trace_sprite_instance = trace.instantiate()
	$traces.add_child(trace_sprite_instance)
	trace_sprite_instance.position = $player_1.position
	trace_sprite_instance.rotation = $player_1.rotation
	while trace_sprite_instance.modulate.a > 0:
		trace_sprite_instance.modulate.a -= 0.03 * 45 * MyDelta
		trace_sprite_instance.modulate.h -= 0.01 * 45 * MyDelta
		print(trace_sprite_instance.modulate.h)
		await get_tree().create_timer(0.0005).timeout
	if trace_sprite_instance.modulate.a <=0:
		trace_sprite_instance.queue_free()

I think it doesn’t work because the saturation value of modulate is 0 by default so changing hue doesn’t do anything. Change the saturation value first

yeah, but it changes the color of the sprite, which isn’t desirable. How do I set it to 1 by default?

You can either make a shader to do a true Hue shift and change the parameters of that dynamically, or just make that sprite where the part you want to change color on is white instead of already that color, then use the modulate to do your coloring in there, including desaturing if you use HSV, etc. That would give you more freedom to change your color scheme pretty easily without altering any texture assets.

2 Likes