def METHOD_NAME(color, offset=0, keep_sum=False):
    if keep_sum:
        mean = (color[0]+color[1]+color[2])/3
        offset = min(mean, 1-mean)*random.random()
        idx = random.randint(0, 2)
        f = 1
        pcg = random.random()
        for i in range(3):
            if i == idx:
                color[i] = mean+offset
            else:
                color[i] = mean-offset*(f*pcg+(1-f)*(1-pcg))
                f = 0
        return
    for i in range(3):
        if offset == 0:
            color[i] = random.random()
        else:
            color[i] += (random.random() - 0.5) * 2 * offset
        color[i] = clip(color[i])