Set a value.

        :param attr: Attribute to set.
        :param value: Value to use.
        :param bottom: Get to bottom value.
        :param top: Get to top value.
        :param to_step: Get to intermediary value.

def _setter(self, attr, value, bottom, top, to_step):
        """ Set a value.

        :param attr: Attribute to set.
        :param value: Value to use.
        :param bottom: Get to bottom value.
        :param top: Get to top value.
        :param to_step: Get to intermediary value.
        """
        if value < 0 or value > 1:
            raise ValueError("out of range")
        if value == 0.0:
            bottom()
        elif value == 1.0:
            top()
        else:
            to_step(value)
        setattr(self, attr, value)