def opacity(self, value):
        """
        Setter for **self.__opacity** attribute.

        :param value: Attribute value.
        :type value: float
        """

        if value is not None:
            assert type(value) in (int, float), "'{0}' attribute: '{1}' type is not 'int' or 'float'!".format("opacity",
                                                                                                              value)
        if value > 1:
            value = 1
        elif value < 0:
            value = 0

        self.__opacity = float(value)
        self.__set_style_sheet()