def _set_annotate_background(self, value):
    self._check_camera_open()
    if (value is True):
        warnings.warn(PiCameraDeprecated('Setting PiCamera.annotate_background to True is deprecated; use PiCamera.color.Color("black") instead'))
        value = Color('black')
    elif (value is False):
        warnings.warn(PiCameraDeprecated('Setting PiCamera.annotate_background to False is deprecated; use None instead'))
        value = None
    elif (value is None):
        pass
    elif (not isinstance(value, Color)):
        raise PiCameraValueError('annotate_background must be a Color or None')
    elif ((self._camera.annotate_rev < 3) and (value.rgb_bytes != (0, 0, 0))):
        warnings.warn(PiCameraFallback('Firmware does not support setting a custom background annotation color; using black instead'))
    mp = self._camera.control.params[mmal.MMAL_PARAMETER_ANNOTATE]
    if (self._camera.annotate_rev == 3):
        if (value is None):
            mp.enable_text_background = False
        else:
            mp.enable_text_background = True
            mp.custom_background_color = True
            (mp.custom_background_Y, mp.custom_background_U, mp.custom_background_V) = value.yuv_bytes
    elif (value is None):
        mp.black_text_background = False
    else:
        mp.black_text_background = True
    self._camera.control.params[mmal.MMAL_PARAMETER_ANNOTATE] = mp
def _set_annotate_background(self, value):
    self._check_camera_open()
    if (value is True):
        warnings.warn(PiCameraDeprecated('Setting PiCamera.annotate_background to True is deprecated; use PiCamera.color.Color("black") instead'))
        value = Color('black')
    elif (value is False):
        warnings.warn(PiCameraDeprecated('Setting PiCamera.annotate_background to False is deprecated; use None instead'))
        value = None
    elif (value is None):
        pass
    elif (not isinstance(value, Color)):
        raise PiCameraValueError('annotate_background must be a Color or None')
    elif ((self._camera.annotate_rev < 3) and (value.rgb_bytes != (0, 0, 0))):
        warnings.warn(PiCameraFallback('Firmware does not support setting a custom background annotation color; using black instead'))
    mp = self._camera.control.params[mmal.MMAL_PARAMETER_ANNOTATE]
    if (self._camera.annotate_rev == 3):
        if (value is None):
            mp.enable_text_background = False
        else:
            mp.enable_text_background = True
            mp.custom_background_color = True
            (mp.custom_background_Y, mp.custom_background_U, mp.custom_background_V) = value.yuv_bytes
    elif (value is None):
        mp.black_text_background = False
    else:
        mp.black_text_background = True
    self._camera.control.params[mmal.MMAL_PARAMETER_ANNOTATE] = mp