11-20-2025, 08:36 AM
My problem is solved.
I had a closer look at my Gimp 2 plug-in and indeed found that I had set the color after inserting the layer. I'm sorry to have overlooked this.
Interesting that to set the name with "textLayer.set_name("My Text")" works before or after inserting the layer.
The working code:
I had a closer look at my Gimp 2 plug-in and indeed found that I had set the color after inserting the layer. I'm sorry to have overlooked this.
Interesting that to set the name with "textLayer.set_name("My Text")" works before or after inserting the layer.
The working code:
Code:
textColor = Gegl.Color.new("red") # e.g.
textLayer = Gimp.TextLayer.new(image, "Text", someFont, sometextSize, Gimp.Unit.pixel())
image.insert_layer(textLayer, parent, position)
textLayer.set_name("Text")
textLayer.set_color(textColor)
