def transition(color1, color2, position):
    """Generates a transitive color between first and second ones, based on the transition argument, where the value 0.0 is equivalent to the first color, and 1.0 is the second color."""
    r1, g1, b1 = color1 >> 16, color1 >> 8 & 0xff, color1 & 0xff
    r2, g2, b2 = color2 >> 16, color2 >> 8 & 0xff, color2 & 0xff
    r = int(r1 + ((r2 - r1) * position) // 1) << 16
    g = int(g1 + ((g2 - g1) * position) // 1) << 8
    b = int(b1 + ((b2 - b1) * position) // 1)
    return r | g | b