Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Gimp 3.0.6 Python plug-in bug with text layer.set_color(color)?
#4
For ease of use, I've also declared a color like this :


Code:
color = Gimp.color_parse_css("rgb(9%, 55%, 77%)")


or without the "%" for rgb 0-255 values

If I'm not mistaken, the GEGL color methods are linear, which makes things a bit un-intuitive.

(11-18-2025, 02:43 PM)Volker Wrote: My environment: Apple Mac mini M2, macOS Tahoe 26.1.

I want to set the color of a text layer from a Python plug-in. In Gimp 2 I used the plug-in "gimp-text-layer-set-color".

In Gimp 3 I find the layer method "set_color(color)", but the color remains to be the foreground color. The same with the PDB plug-in.
First try with layer method:
Code:
textColor = Gegl.Color.new("red") # e.g.
textLayer = Gimp.TextLayer.new(image, "Text", someFont, sometextSize, Gimp.Unit.pixel())
textLayer.set_name("Text")
textLayer.set_color(textColor)
image.insert_layer(textLayer, parent, position)
The text is black.
Next try with pdb proc:


Where is the error? With my code or with Gimp?

I'm surprised
Code:
myTextLayer.set_color(textColor)

doesn't work.

Did you try it after inserting the text layer into the image ?
Reply


Messages In This Thread
RE: Gimp 3.0.6 Python plug-in bug with text layer.set_color(color)? - by Scallact - 11-19-2025, 08:02 PM

Forum Jump: