<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def hex2term(hexval: str, allow_short: bool = False) -> str: """ Convert a hex value into the nearest terminal code number. """

    return rgb2term(*hex2rgb(hexval, allow_short=allow_short))