# Path: matplotlib/colors.py
# def is_color_like(c):
#     'Return *True* if *c* can be converted to *RGB*'
#     try:
#         colorConverter.to_rgb(c)
#         return True
#     except ValueError:
#         return False


import os
import warnings
from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
from matplotlib.colors import is_color_like
class validate_nseq_int:
    def __init__(self, n):
        self.n = n

    def __call__(self, s):
        """return a seq of n ints or raise"""
        if type(s) is str:
            ss = s.split(',')
            if len(ss) != self.n:
                raise ValueError(
                    'You must supply exactly %d comma separated values' %
                    self.n)
            try:
                return [int(val) for val in ss]
            except ValueError:
                raise ValueError('Could not convert all entries to ints')
        else:
            assert type(s) in (list, tuple)
            if len(s) != self.n:
                raise ValueError('You must supply exactly %d values' % self.n)
            return [int(val) for val in s]


def validate_color(s):
    'return a valid color arg'
    try:
        if s.lower() == 'none':
            return 'None'
    except AttributeError:
        pass

# Path: matplotlib/colors.py
# def is_color_like(c):
#     'Return *True* if *c* can be converted to *RGB*'
#     try:
#         colorConverter.to_rgb(c)
#         return True
#     except ValueError:
#         return False


# Path: matplotlib/rcsetup.py
import os
import warnings
from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
from matplotlib.colors import is_color_like

class validate_nseq_int:
    def __init__(self, n):
        self.n = n

    def __call__(self, s):
        """return a seq of n ints or raise"""
        if type(s) is str:
            ss = s.split(',')
            if len(ss) != self.n:
                raise ValueError(
                    'You must supply exactly %d comma separated values' %
                    self.n)
            try:
                return [int(val) for val in ss]
            except ValueError:
                raise ValueError('Could not convert all entries to ints')
        else:
            assert type(s) in (list, tuple)
            if len(s) != self.n:
                raise ValueError('You must supply exactly %d values' % self.n)
            return [int(val) for val in s]


def validate_color(s):
    'return a valid color arg'
    try:
        if s.lower() == 'none':
            return 'None'
    except AttributeError:
        pass

    if is_color_like(s):