Please ignore the blue line. Basically, I want to use select > color range or magic wand to make some selections and for each selected patch I would like to apply some gradient in the center of the patch.
Pseudo code would be:
select current active layer
apply color range or magic wand selection
for each sub selection in main selection:
do:
calculate the center coordinate of the current sub-selection area
apply a custom gradient using the coordinate as the starting point
I am not sure if this is do able because I don't know if the color range or magic want selection contains "sub-selections". By sub-selections I mean each individual patch in the above image.