def copy_color_and_brightness_module() -> None:
    """Copy the color_and_brightness module to the webapp folder."""
    with suppress(Exception):
        webapp_folder = Path(__file__).parent.absolute()
        module = (
            webapp_folder.parent
            / "custom_components"
            / "adaptive_lighting"
            / "color_and_brightness.py"
        )
        new_module = webapp_folder / module.name
        with module.open() as f:
            lines = [
                line.replace("homeassistant.util.color", "homeassistant_util_color")
                for line in f.readlines()
            ]
        with new_module.open("r") as f:
            existing_lines = f.readlines()
        if existing_lines != lines:
            with new_module.open("w") as f:
                f.writelines(lines)
Copy the color_and_brightness module to the webapp folder.
webapp/app.py