How do I only have hue selector in ColorPicker?

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

I’d like to have a colorpicker in my project, but only for the hue, and not brightness, saturation, raw, etc… Is there a way to do this? Or do i have to make my own node?

:bust_in_silhouette: Reply From: jgodfrey

I’m not sure exactly what parts of the ColorPicker control you want to keep and what parts you want to remove. However, the control is made up of other, standard Godot GUI components. You can step through the components via get_children() calls to find out how the control is constructed.

From there, you can simply hide the parts you don’t want to see (via <control>.visible = false).

Here’s a quick hack that’ll step through a control and dump out all of its children. It’ll call itself recursively on any container node…

func recurse_get_children(ctrl):
	for child in ctrl.get_children():
		if child is Container:
			print("> ", child)
			recurse_get_children(child)
		else:
		   print("    ", child)

You could pass your color picker into that to get a better understanding of its construction. So, something like:

recurse_get_children($ColorPicker)

Using the info you get back, you can selectively hide parts of the ColorPicker as needed.