def color_temperature_to_rgbww(
    temperature: int,
    brightness: int,
    min_kelvin: int,
    max_kelvin: int,
) -> tuple[int, int, int, int, int]:
    """Convert color temperature in kelvin to rgbcw.

    Returns a (r, g, b, cw, ww) tuple.
    """
    max_mireds = color_temperature_kelvin_to_mired(min_kelvin)
    min_mireds = color_temperature_kelvin_to_mired(max_kelvin)
    temperature = color_temperature_kelvin_to_mired(temperature)
    mired_range = max_mireds - min_mireds
    cold = ((max_mireds - temperature) / mired_range) * brightness
    warm = brightness - cold
    return (0, 0, 0, round(cold), round(warm))
Convert color temperature in kelvin to rgbcw.

    Returns a (r, g, b, cw, ww) tuple.
    
webapp/homeassistant_util_color.py