How to do "get_property_list()" for "colors" ?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By lamkka

I would like to return an array showing all properties of a color (e.g. control.modulate). To mean “All Properties”, I refer to those listed in the Color Entry of the Docs. I have tried the following code:Contorl.modulate.get_property_list()but it gives an error

Invalid call. Nonexistent function ‘get _ property _ list’ in base ‘Color’.

Thanks for your help in advance!

(My original motive is to Tween on the alpha value of a Control.modulate to give a fading effect. I found in another post that it suffices to use $Tween.interpolate_property(Control, "modulate:a", 1 , 0, 5)
to directly animate the alpha value instead of animating the whole modulate property by like doing

var final_color = Control.modulate
final_color.a = 0	#changing the alpha value
$Tween.interpolate_property(prologue_label,"modulate",modulate,final_color,5)

I wondered how could I get the string "modulate:a"corresponding to the alpha property of the modulate and tried to see if I could print the property list of the modulate to find out the string "modulate:a". This gives the current question after finding out that I cannot use get_property_list() on a Color in general.)

Color does not inherit from Object, so it does not have get_property_list method. It is unclear for me why do you need to get property_list of Color, if you already know all properties it have?

AlexTheRegent | 2021-01-03 23:06

:bust_in_silhouette: Reply From: Lopy

Color has the following properties:
float : r, g, b, a, h, s, v. int : r8, g8, b8, a8.
As mentioned above, get_property_list() is available for any Object, but Color does not extend Object.

“modulate:a” is a NodePath, with “:” serving the purpose of “.” in your code. It refers to your prologue_label.modulate.a.