def colorByRGB(*args):

    if len(args) == 4:
        (rgb, h, s, v) = args
    elif len(args) == 2:
        (rgb, hsv) = args
        (h, s, v) = hsv

    (blue, green, red) = rgb
    (blueOff, greenOff, redOff) = profiles.rgbOffset
    red += redOff
    green += greenOff
    blue += blueOff

    green = float(max(green, 1))
    red = float(max(red, 1))
    blue = float(max(blue, 1))

    if blue / red > 2 and blue / green > 2: 
        return 'blue'
    elif green / red > 2:
        return 'green'

    if h > 150 or h < 6:
        return 'red'
    elif h < 20 and s < 150:
        return 'white'
    elif h < 20:
        return 'orange'
    elif h < 50:
        return 'yellow'

    return 'white'
dataset/ETHPy150Open bluquar/cubr/coloranalytics.py/colorByRGB/original