def interpolate_colors(a, b, bias):
    """takes two RGB tuples and returns a componentwise weighted average"""
    return (
        int(a[0] * (1 - bias) + b[0] * bias),
        int(a[1] * (1 - bias) + b[1] * bias),
        int(a[2] * (1 - bias) + b[2] * bias),
    )