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:
@ -82,19 +82,12 @@ are now in their own module:
|
|||||||
Gimp.ChannelOps.REPLACE
|
Gimp.ChannelOps.REPLACE
|
||||||
```
|
```
|
||||||
|
|
||||||
## Gimp.RGB
|
## Gegl.Color
|
||||||
|
|
||||||
In legacy plug-ins you could pass a simple list of integers, like (0, 0, 0).
|
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 = Gegl.Color.new("black")
|
||||||
c.set(240.0, 180.0, 70.0)
|
c.set_rgba(0.94, 0.71, 0.27, 1.0)
|
||||||
```
|
|
||||||
or
|
|
||||||
```
|
|
||||||
c.r = 0
|
|
||||||
c.g = 0
|
|
||||||
c.b = 0
|
|
||||||
c.a = 1
|
|
||||||
```
|
```
|
||||||
|
@ -60,8 +60,8 @@ pdb.script_fu_drop_shadow(img, layer, -3, -3, blur,
|
|||||||
```
|
```
|
||||||
becomes
|
becomes
|
||||||
```
|
```
|
||||||
c = Gimp.RGB()
|
c = Gegl.Color.new("black")
|
||||||
c.set(240.0, 180.0, 70.0)
|
c.set_rgba(0.94, 0.71, 0.27, 1.0)
|
||||||
Gimp.get_pdb().run_procedure('script-fu-drop-shadow',
|
Gimp.get_pdb().run_procedure('script-fu-drop-shadow',
|
||||||
[ Gimp.RunMode.NONINTERACTIVE,
|
[ Gimp.RunMode.NONINTERACTIVE,
|
||||||
GObject.Value(Gimp.Image, img),
|
GObject.Value(Gimp.Image, img),
|
||||||
|
Reference in New Issue
Block a user