import difflib
import click


def pretty_diff_ans(a, b):
    """Compare `a` and `b` returning a list of ANSI styled string
    and a boolean indicating if `a` and `b` are equal"""
    d = difflib.ndiff(a, b)
    ret = []
    equal = True
    for s in d:
        if s.startswith('- '):
            ret.append(click.style(s, fg='red'))
        elif s.startswith('? '):
            equal = False
            ret.append(click.style(s, fg='cyan'))
        else:
            ret.append(click.style(s, fg='green'))
    return ret, equal