Gimp.Image.prototype.get_active_layer

function get_active_layer(): Gimp.Layer {
    // Gjs wrapper for gimp_image_get_active_layer()
}
  

Returns the specified image's active layer.

If there is an active layer, its ID will be returned, otherwise, -1. If a channel is currently active, then no layer will be. If a layer mask is active, then this will return the associated layer.

Returns

The active layer.