    def test_label_colours(self):
        """
        Check Label custom colour works.
        """
        screen = MagicMock(spec=Screen, colours=8, unicode_aware=False)
        scene = Scene([], duration=-1)
        canvas = Canvas(screen, 10, 40, 0, 0)
        form = Frame(canvas, canvas.height, canvas.width)
        layout = Layout([1])
        form.add_layout(layout)
        label = Label("Some text")
        label.custom_colour = "disabled"
        layout.add_widget(label)
        form.fix()
        scene.add_effect(form)
        scene.reset()

        # Check that the label is rendered in the correct colour palette.
        for effect in scene.effects:
            effect.update(0)
        self.assertEqual(label.custom_colour, "disabled")
        self.assertEqual(canvas.get_from(1, 1), (ord("S"), 0, 1, 4))

        # Cheeky test that Labels always pass on events.
        event = object()
        self.assertEqual(event, label.process_event(event))
Check Label custom colour works.
tests/test_widgets.py