#!/usr/bin/env python3 color = 0x0000ff def rainbow_gen(color): if (color & 0x0000ff == 0xff) and (color ^ 0xff0000 == 0xff) and (color ^ 0x00ff00 < 0xff): color += 0x100 color -= 1 print("test") return color while True: color = rainbow_gen(color) print(hex(color))