Gtk.Widget.prototype.set_opacity

function set_opacity(opacity:Number):void {
    // Gjs wrapper for gtk_widget_set_opacity()
}

Request the widget to be rendered partially transparent, with opacity 0 being fully transparent and 1 fully opaque. (Opacity values are clamped to the [0,1] range.). This works on both toplevel widget, and child widgets, although there are some limitations:

For toplevel widgets this depends on the capabilities of the windowing system. On X11 this has any effect only on X screens with a compositing manager running. See Gtk.Widget.prototype.is_composited. On Windows it should work always, although setting a window's opacity after the window has been shown causes it to flicker once on Windows.

For child widgets it doesn't work if any affected widget has a native window, or disables double buffering.

Since 3.8

opacity

desired opacity, between 0 and 1