Self modulate going into the extremes

Godot Version

4.4

Question

Hey !! Hello there !!!
So basically I’m trying to use self_modulate to change the color of one of my sprites. It works well when I change the color in the editor, but when I try to change the self_modulate value on runtime, it only works with values of 255 and 0 ; for exemple:

sprite.self_modulate = Color(0,0,255,255)

will work !
But

sprite.self_modulate = Color(120,255,90,255)

Will not work :expressionless:

Do you know the reason for this ?
Thank you very much !!

The Color constructor takes values from 1.0 to 0.0, not 255 to 0. Maybe you would have better luck with Color8/Color.from_rgba8, which does use the 255-0 range.

1 Like