def format_color(
    color: ColorType | Var[str], shade: ShadeType | Var[int], alpha: bool | Var[bool]
) -> str:
    """Format a color as a CSS color string.

    Args:
        color: The color to use.
        shade: The shade of the color to use.
        alpha: Whether to use the alpha variant of the color.

    Returns:
        The formatted color.
    """
    if isinstance(alpha, bool):
        return f"var(--{color}-{'a' if alpha else ''}{shade})"

    from reflex.components.core import cond

    alpha_var = cond(alpha, "a", "")
    return f"var(--{color}-{alpha_var}{shade})"
Format a color as a CSS color string.

    Args:
        color: The color to use.
        shade: The shade of the color to use.
        alpha: Whether to use the alpha variant of the color.

    Returns:
        The formatted color.
    
reflex/constants/colors.py