(color)
return is_atomic
Determine whether the argument is a singe color or an iterable of colors
Determine whether the argument is a singe color or an iterable of colors
Determine whether the argument is a singe color or an iterable of colors
def is_color_atomic(color):
    """
    Determine whether the argument is a singe color or an iterable of colors
    """
    if isinstance(color, string_types):
        is_atomic = True
    elif isinstance(color, collections.Sequence):
        if isinstance(color[0], string_types):
            is_atomic = False
        elif isinstance(color[0], (int, float)) and len(color) in (3, 4):
            is_atomic = True
        else:
            is_atomic = False
    else:
        is_atomic = True
    return is_atomic
def is_color_atomic ( color ) : if isinstance ( color , string_types ) : is_atomic = True elif isinstance ( color , collections . Sequence ) : if isinstance ( color [ 0 ] , string_types ) : is_atomic = False elif isinstance ( color [ 0 ] , ( int , float ) ) and len ( color ) in ( 3 , 4 ) : is_atomic = True else : is_atomic = False else : is_atomic = True return is_atomic