def rel_calc(n):
    """Calculate the colour-specific bit, given a colour hex-string."""
    n = int(n, 16) / 255
    if n <= 0.03928:
        n = n / 12.92
    else:
        n = ((n + 0.055) / 1.055) ** 2.4
    return n
