def _str_to_hex(s: str) -> str:
    """
    Convert given string to hex string.

    given string can be one of hex format, int, or a float between 0 and 1.

    >>> _str_to_hex('0xFf')
    'Ff'
    >>> _str_to_hex('200')
    'c8'
    >>> _str_to_hex('0.52')
    '84'
    """
    if s.startswith('0x'):
        return s[2:].zfill(2)
    if s.isdigit():
        return hex(int(s))[2:].zfill(2)
    return hex(int(float(s) * 255))[2:].zfill(2)