#
# (C) Oriol Boix 2018
#
import math
def colorRGB(H):
    C = int(255*(1-math.fabs((((math.fabs(H) % 360)/60) % 2)-1)))
    if (H >= 0) and (H < 60):
        return (255, C, 0)
    if (H >= 60) and (H < 120):
        return (C, 255, 0)
    if (H >= 120) and (H < 180):
        return (0, 255, C)
    if (H >= 180) and (H < 240):
        return (0, C, 255)
    if (H >= 240) and (H < 300):
        return (C, 0, 255)
    if (H >= 300) and (H <= 360):
        return (255, 0, C)