def determine_color(memory_limit_gb, memory_usage_gb, dark_background=False):
    """Determine a display color based on percent memory usage
    
    Parameters
    ----------
    memory_limit_gb : int
        Overall memory limit in gigabytes
    memory_usage_gb : int
        Memory usage value in gigabytes
    dark_background : bool
        Use a dark background color schme
    
    Returns
    -------
    str
        Color string for `fancyprint.fprint`
    """

    for threshold, color in zip(
        (memory_limit_gb * x / 4 for x in (3, 2, 1, 0)),
        (
            ('r', 'y', 'g', 'c')
            if dark_background else ('dr', 'dy', 'dg', 'dc')
        )
    ):
        if memory_usage_gb > threshold:
            return color
    else:
        return ''