Question by
muckenhoupt · Sep 25, 2020 at 09:05 AM ·
colorpicker
Invoking color picker directly
I'm writing a custom editor in which I want the user to be able set colors of certain elements -- specifically, I'm using GraphView, and I want to set colors of nodes, but that's not important. Ideally, I want to put an action "Set Color" into the context menu, and when the user selects that, it pops up a color picker just like the one you get when you click on a Color field in the Inspector. But the only way I've found to invoke that color picker is through a Color field, either in an Inspector or created with EditorGUILayout.ColorField. I don't want to create an extra GUI element just as a way to bring up a picker for a color that's already on the screen! Is there any way to invoke the picker directly from script?
Comment