meshlabxml/util.py
def color_values(color):
    """Read color_names.txt and find the red, green, and blue values
        for a named color.
    """
    # Get the directory where this script file is located:
    this_dir = os.path.dirname(
        os.path.realpath(
            inspect.getsourcefile(
                lambda: 0)))
    color_name_file = os.path.join(this_dir, 'color_names.txt')
    found = False
    for line in open(color_name_file, 'r'):
        line = line.rstrip()
        if color.lower() == line.split()[0]:
            #hex_color = line.split()[1]
            red = line.split()[2]
            green = line.split()[3]
            blue = line.split()[4]
            found = True
            break
    if not found:
        print('Color name "%s" not found, using default (white)' % color)
        red = 255
        green = 255
        blue = 255
    return red, green, blue
def color_values(color):
    """Read color_names.txt and find the red, green, and blue values
        for a named color.
    """
    # Get the directory where this script file is located:
    this_dir = os.path.dirname(
        os.path.realpath(
            inspect.getsourcefile(
                lambda: 0)))
    color_name_file = os.path.join(this_dir, 'color_names.txt')
    found = False
    for line in open(color_name_file, 'r'):
        line = line.rstrip()
        if color.lower() == line.split()[0]:
            #hex_color = line.split()[1]
            red = line.split()[2]
            green = line.split()[3]
            blue = line.split()[4]
            found = True
            break
    if not found:
        print('Color name "%s" not found, using default (white)' % color)
        red = 255
        green = 255
        blue = 255
    return red, green, blue
def color_values ( color ) : # Get the directory where this script file is located: this_dir = os . path . dirname ( os . path . realpath ( inspect . getsourcefile ( lambda : 0 ) ) ) color_name_file = os . path . join ( this_dir , 'color_names.txt' ) found = False for line in open ( color_name_file , 'r' ) : line = line . rstrip ( ) if color . lower ( ) == line . split ( ) [ 0 ] : #hex_color = line.split()[1] red = line . split ( ) [ 2 ] green = line . split ( ) [ 3 ] blue = line . split ( ) [ 4 ] found = True break if not found : print ( 'Color name "%s" not found, using default (white)' % color ) red = 255 green = 255 blue = 255 return red , green , blue
Read color_names.txt and find the red, green, and blue values
        for a named color.
Read color_names . txt and find the red green and blue values for a named color .