def f2hex(flo):
    """Convert floating point value `flo` (`0 <= f <=1`) to a zero-padded hex string."""
    if not 0 <= flo <= 1:
        raise ValueError("value must be between 0 and 1 (inclusive)", flo)
    intval = round(255 * flo)
    return f"{intval:X}".zfill(2)