Set/get actor's transparency.
12399
def alpha(self, a=None):
        """"""
        if a is not None:
            self.GetProperty().SetOpacity(a)
            return self
        else:
            return self.GetProperty().GetOpacity()
733578
public static void setKeyboardFocus(final Actor actor) {
        if (actor != null && actor.getStage() != null) {
            actor.getStage().setKeyboardFocus(actor);
        }
    }
1215604
function(ranges, elems, hiddenOpacity, animDuration) {
            var self = this;
            // Hold the final opacity value for all elements consolidated after applying each ranges
            // This allow to set the opacity only once for each elements
            var elemsFinalOpacity = {};

            // set object with one valueIndex to 0 if we have directly the min/max
            if (ranges.min !== undefined || ranges.max !== undefined) {
                ranges = {0: ranges};
            }

            // Loop through each valueIndex
            $.each(ranges, function (valueIndex) {
                var range = ranges[valueIndex];
                // Check if user defined at least a min or max value
                if (range.min === undefined && range.max === undefined) {
                    return true; // skip this iteration (each loop), goto next range
                }
                // Loop through each elements
                $.each(elems, function (id) {
                    var elemValue = elems[id].options.value;
                    // set value with one valueIndex to 0 if not object
                    if (typeof elemValue !== "object") {
                        elemValue = [elemValue];
                    }
                    // Check existence of this value index
                    if (elemValue[valueIndex] === undefined) {
                        return true; // skip this iteration (each loop), goto next element
                    }
                    // Check if in range
                    if ((range.min !== undefined && elemValue[valueIndex] < range.min) ||
                        (range.max !== undefined && elemValue[valueIndex] > range.max)) {
                        // Element not in range
                        elemsFinalOpacity[id] = hiddenOpacity;
                    } else {
                        // Element in range
                        elemsFinalOpacity[id] = 1;
                    }
                });
            });
            // Now that we looped through all ranges, we can really assign the final opacity
            $.each(elemsFinalOpacity, function (id) {
                self.setElementOpacity(elems[id], elemsFinalOpacity[id], animDuration);
            });
        }
993461
def _update_preview(self):
        """"""
        color = self.hexa.get()
        if self.alpha_channel:
            prev = overlay(self._transparent_bg, hexa_to_rgb(color))
            self._im_color = ImageTk.PhotoImage(prev, master=self)
            self.color_preview.configure(image=self._im_color)
        else:
            self.color_preview.configure(background=color)
835198
def matte_replace(x, y)
      f = copy
      f.opacity = OpaqueOpacity unless f.alpha?
      target = f.pixel_color(x, y)
      f.transparent(target)
    end
203741
def file_set_visibility(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/setVisibility' % object_id, input_params, always_retry=always_retry, **kwargs)
380624
def do(actor, targets)
    actor.color.red += (@color.red - actor.color.red) * delta
    actor.color.green += (@color.green - actor.color.green) * delta
    actor.color.blue += (@color.blue - actor.color.blue) * delta
  end
1160397
function (ui) {
					try {
						var all = ui.val('all');
						activePreview.css({
							backgroundColor: all && '#' + all.hex || 'transparent'
						});
						setAlpha.call($this, activePreview, all && mPrecision((all.a * 100) / 255, 4) || 0);
					} catch (e) {}
				}
570434
function(ui, context)
              {
                var hex = ui.val('hex');
                currentPreview.css({ backgroundColor: hex && '#' + hex || 'transparent' });
                setAlpha.call($this, currentPreview, Math.precision(((ui.val('a') || 0) * 100) / 255, 4));
              }
670281
def _update_axes_color(self, color):
        """"""
        prop_x = self.axes_actor.GetXAxisCaptionActor2D().GetCaptionTextProperty()
        prop_y = self.axes_actor.GetYAxisCaptionActor2D().GetCaptionTextProperty()
        prop_z = self.axes_actor.GetZAxisCaptionActor2D().GetCaptionTextProperty()
        if color is None:
            color = rcParams['font']['color']
        color = parse_color(color)
        for prop in [prop_x, prop_y, prop_z]:
            prop.SetColor(color[0], color[1], color[2])
            prop.SetShadow(False)
        return
1315502
def addCutterTool(actor):
    
    if isinstance(actor, vtk.vtkVolume):
        return _addVolumeCutterTool(actor)
    elif isinstance(actor, vtk.vtkImageData):
        from vtkplotter import Volume
        return _addVolumeCutterTool(Volume(actor))

    vp = settings.plotter_instance
    if not vp.renderer:
        save_int = vp.interactive
        vp.show(interactive=0)
        vp.interactive = save_int

    vp.clickedActor = actor
    if hasattr(actor, "polydata"):
        apd = actor.polydata()
    else:
        apd = actor.GetMapper().GetInput()

    planes = vtk.vtkPlanes()
    planes.SetBounds(apd.GetBounds())

    clipper = vtk.vtkClipPolyData()
    clipper.GenerateClipScalarsOff()
    clipper.SetInputData(apd)
    clipper.SetClipFunction(planes)
    clipper.InsideOutOn()
    clipper.GenerateClippedOutputOn()

    act0Mapper = vtk.vtkPolyDataMapper()  # the part which stays
    act0Mapper.SetInputConnection(clipper.GetOutputPort())
    act0 = Actor()
    act0.SetMapper(act0Mapper)
    act0.GetProperty().SetColor(actor.GetProperty().GetColor())
    act0.GetProperty().SetOpacity(1)

    act1Mapper = vtk.vtkPolyDataMapper()  # the part which is cut away
    act1Mapper.SetInputConnection(clipper.GetClippedOutputPort())
    act1 = vtk.vtkActor()
    act1.SetMapper(act1Mapper)
    act1.GetProperty().SetOpacity(0.02)
    act1.GetProperty().SetRepresentationToWireframe()
    act1.VisibilityOn()

    vp.renderer.AddActor(act0)
    vp.renderer.AddActor(act1)
    vp.renderer.RemoveActor(actor)

    def SelectPolygons(vobj, event):
        vobj.GetPlanes(planes)

    boxWidget = vtk.vtkBoxWidget()
    boxWidget.OutlineCursorWiresOn()
    boxWidget.GetSelectedOutlineProperty().SetColor(1, 0, 1)
    boxWidget.GetOutlineProperty().SetColor(0.1, 0.1, 0.1)
    boxWidget.GetOutlineProperty().SetOpacity(0.8)
    boxWidget.SetPlaceFactor(1.05)
    boxWidget.SetInteractor(vp.interactor)
    boxWidget.SetInputData(apd)
    boxWidget.PlaceWidget()
    boxWidget.AddObserver("InteractionEvent", SelectPolygons)
    boxWidget.On()

    vp.cutterWidget = boxWidget
    vp.clickedActor = act0
    ia = vp.actors.index(actor)
    vp.actors[ia] = act0

    colors.printc("Mesh Cutter Tool:", c="m", invert=1)
    colors.printc("  Move gray handles to cut away parts of the mesh", c="m")
    colors.printc("  Press X to save file to: clipped.vtk", c="m")

    vp.interactor.Start()
    boxWidget.Off()
    vp.widgets.append(boxWidget)

    vp.interactor.Start()  # allow extra interaction

    return act0
147529
def _set_visible(self, visibility, grid_index=None):
        """"""

        if grid_index is None:
            for ax in self.flat_grid:
                ax.set_visible(visibility)
        else:
            if grid_index < 0 or grid_index >= len(self.grids):
                raise IndexError('Valid indices : 0 to {}'.format(len(self.grids) - 1))
            for ax in self.grids[grid_index]:
                ax.set_visible(visibility)
1034373
function forLeftButton(props) {
  const { position, scene, scenes } = props;
  const interpolate = getSceneIndicesForInterpolationInputRange(props);

  if (!interpolate) return { opacity: 0 };

  const { first, last } = interpolate;
  const index = scene.index;

  return {
    opacity: position.interpolate({
      inputRange: [
        first,
        first + Math.abs(index - first) / 2,
        index,
        last - Math.abs(last - index) / 2,
        last,
      ],
      outputRange: [0, 0.5, 1, 0.5, 0],
    }),
  };
}
917289
def _set_tick_lines_visibility(ax, visible=True):
    """"""
    for i, thisAxis in enumerate((ax.get_xaxis(), ax.get_yaxis())):
        for thisItem in thisAxis.get_ticklines():
            if isinstance(visible, list):
                thisItem.set_visible(visible[i])
            else:
                thisItem.set_visible(visible)
119992
def record_set_visibility(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/setVisibility' % object_id, input_params, always_retry=always_retry, **kwargs)
997962
def set_actor(user, sender, instance, signal_duid, **kwargs):
        
        if hasattr(threadlocal, 'auditlog'):
            if signal_duid != threadlocal.auditlog['signal_duid']:
                return
            try:
                app_label, model_name = settings.AUTH_USER_MODEL.split('.')
                auth_user_model = apps.get_model(app_label, model_name)
            except ValueError:
                auth_user_model = apps.get_model('auth', 'user')
            if sender == LogEntry and isinstance(user, auth_user_model) and instance.actor is None:
                instance.actor = user

            instance.remote_addr = threadlocal.auditlog['remote_addr']
974467
function (ui, context) {
					var hex = ui.val('hex');
					currentPreview.css({
						backgroundColor: hex && '#' + hex || 'transparent'
					});
					setAlpha.call($this, currentPreview, mPrecision(((ui.val('a') || 0) * 100) / 255, 4));
				}