def get_align_from_hjust(hjust: float) -> str:
    """
    Maps 0 -> 'left', 0.5 -> 'center', 1 -> 'right'
    ... and in-between things get nudged to the nearest of those three.
    """
    if hjust <= 0.25:
        return 'left'
    elif hjust >= 0.75:
        return 'right'
    return 'center'