def darken(color):
    if color[0] != '#':
        if color == 'white':
            color = '#ffffff'
        elif color == 'orange':
            color = '#ffa500'
        elif color == 'red':
            color = '#ff0000'
        elif color == 'blue':
            color = '#0000ff'
        elif color == 'green':
            color = '#00ff00'
        elif color == 'yellow':
            color = '#ffff00'
        else: return color
        return darken(color)
    else:
        red = int(color[1:3], 16)
        green = int(color[3:5], 16)
        blue = int(color[5:7], 16)
        red /= 2
        green /= 2
        blue /= 2
        return (red, green, blue) % '#%02x%02x%02x'
dataset/ETHPy150Open bluquar/cubr/cube.py/darken/swapped operands of `%`