def color_rgbw_to_rgb(r: int, g: int, b: int, w: int) -> tuple[int, int, int]:
    """Convert an rgbw color to an rgb representation."""
    # Add the white channel to the rgb channels.
    rgb = (r + w, g + w, b + w)

    # Match the output maximum value to the input. This ensures the
    # output doesn't overflow.
    return match_max_scale((r, g, b, w), rgb)  # type: ignore[return-value]
Convert an rgbw color to an rgb representation.
webapp/homeassistant_util_color.py