But which event class should I give the descriptor in the first place? I know I could set the gradient of a gradient (/gradientMap) adjustment layer, but wouldn’t I need to create one first of all?
Got it, but that’s just the gradient panel I assume. What I need is some call that returns a complete gradient descriptor, just like the color picker returns a color descriptor.
Which specific two do you mean? I know that you can trigger it in the UI from various places, such as the gradient tool bar, adjustment layer, layer effects etc.
Right now I see the following two possibilites:
Allow the user to pick a few colors (2 or 3 maybe) and maybe a direction, to then create a gradient descriptor based on that on my own. Kind of like a very very basic gradient editor…
Upon button click, show the user a message asking him to confirm or change the gradient from the tool bar. Then switch the active tool and listen for modalStateChanged including
"Gradient Editor". After the event fires you could read out the gradient from the currentToolOptions.