def _get_domain_factor(df: DataFrameLike, vals: list[str]) -> list[str]:
    """
    Get the domain of factor values.

    Get the domain of factor values in `vals=` as a list of the unique values in the order provided.
    """

    # Exclude any NA values from `vals`
    vals = [x for x in vals if not is_na(df, x)]

    # Create the domain by getting the unique values in `vals` in order provided
    seen: list[str] = []

    for item in vals:
        if item not in seen:
            seen.append(item)

    return seen

    Get the domain of factor values.

    Get the domain of factor values in `vals=` as a list of the unique values in the order provided.
    
great_tables/_data_color/base.py