when you seem to intended to fill a regular pixel Layer and not a Fill Layer?
Using the paint bucket tool for this seem a pretty peculiar idea, suppose the Tool is set to »All Layers«.
That first block (by no means complete) is just an example of the kind of way you can determine a color through scripting.. It is what i can't figure out how to implement into this second code block, taken from the script listener, which will simply use the color currently set to the foreground color to fill the layer.
The Paint Bucket Tool can be set to »Foreground« or »Pattern«, so what makes you think you can do differently with Scripting?
I guess you may have to set the Foreground Color if you insist on using the Paint Bucket Tool.
ah, good point.
Actually I can’t rule out that it may be possible to feed the color values directly to the tool application, but I don’t know how and setting the foreground color back to the original color should be no problem if you want to keep that.