def srgb_to_linear(c):
    """Convert SRGB value of a color channel to linear value."""
    assert 0 <= c <= 1
    if c <= 0.03928:
        return c /12.92
    else:
        return ((c + 0.055) / 1.055)**2.4