devel-docs: Replace Gimp.RGB with Gegl.Color

Updating Python plug-in developer
instructions to use Gegl.Color instead of
Gimp.RGB.
This commit is contained in:
Alx Sa 2024-03-12 14:51:20 +00:00
parent 85bb1790b7
commit f39af05a48
2 changed files with 6 additions and 13 deletions

View File

@ -82,19 +82,12 @@ are now in their own module:
Gimp.ChannelOps.REPLACE
```
## Gimp.RGB
## Gegl.Color
In legacy plug-ins you could pass a simple list of integers, like (0, 0, 0).
In 3.0+, create a Gimp.RGB object:
In 3.0+, create a Gegl.Color object:
```
c = Gimp.RGB()
c.set(240.0, 180.0, 70.0)
```
or
```
c.r = 0
c.g = 0
c.b = 0
c.a = 1
c = Gegl.Color.new("black")
c.set_rgba(0.94, 0.71, 0.27, 1.0)
```

View File

@ -60,8 +60,8 @@ pdb.script_fu_drop_shadow(img, layer, -3, -3, blur,
```
becomes
```
c = Gimp.RGB()
c.set(240.0, 180.0, 70.0)
c = Gegl.Color.new("black")
c.set_rgba(0.94, 0.71, 0.27, 1.0)
Gimp.get_pdb().run_procedure('script-fu-drop-shadow',
[ Gimp.RunMode.NONINTERACTIVE,
GObject.Value(Gimp.Image, img),