Gimp-Forum.net
Python fu : Gradient API - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP)
+---- Forum: Scripting questions (https://www.gimp-forum.net/Forum-Scripting-questions)
+---- Thread: Python fu : Gradient API (/Thread-Python-fu-Gradient-API)



Python fu : Gradient API - awan - 08-24-2018

How to get color from gradient at certain position ?


RE: Python fu : Gradient API - Ofnuts - 08-24-2018

You use pdb.gimp_gradient_get_custom_samples() with a list of one element:
Code:
pdb.gimp_gradient_get_custom_samples(gradient,1,[.5],False)

But it is usually better to get all your gradient samples at the same time using a single call with a list of positions...


RE: Python fu : Gradient API - awan - 08-24-2018

That's what I'm looking for. Thank you