def makecolor(color):
    if color == 0.5:
        print "0 0 0"
        return
    color = 1 - color
    if color > 0.5:
        # red
        color = min(1, 1 - 2 * color)
        col0 = [0.1, 0, 0.5]
        col1 = [1, 0, 0]
    else:
        # green
        color = min(1, 1 - 2 * color)
        col0 = [0.1, 0.2, 0.05]
        col1 = [0.9, 1, 0.2]
    print col0[0] + color * (col1[0] - col0[0]),\
        col0[1] + color * (col1[1] - col0[1]),\
        col0[2] + color * (col1[2] - col0[2])
dataset/ETHPy150Open CGATOxford/cgat/scripts/go2plot.py/makecolor/swapped operands of `-`