def brightness(rrggbb):
    """ W3C brightness definition
        input:
            hexadecimal color in the format:
            #RRGGBB
        output: value between 0 and 1
    """
    print(rrggbb)
    rr = int(rrggbb[1:3], 16) / int('FF', 16)
    gg = int(rrggbb[3:5], 16) / int('FF', 16)
    bb = int(rrggbb[5:7], 16) / int('FF', 16)
    return (rr * 299.0 + gg * 587.0 + bb * 114.0) / 1000.0
