def parse_color(src=None):<EOL>
if src is None:<EOL><INDENT>return None<EOL><DEDENT>if src[<NUM_LIT:0>] == "<STR_LIT:(>":<EOL><INDENT>rgba = tuple(int(v) for v in src[<NUM_LIT:1>:-<NUM_LIT:1>].split("<STR_LIT:U+002C>") if v)<EOL>if not (len(rgba) == <NUM_LIT:4> and all(<NUM_LIT:0> <= v < <NUM_LIT> for v in rgba)):<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>".format(<EOL>src<EOL>)<EOL>)<EOL><DEDENT>return rgba<EOL><DEDENT>return int(src)<EOL>
Parse a string representing a color value.

    Color is either a fixed color (when coloring something from the UI, see
    the GLYPHS_COLORS constant) or a list of the format [u8, u8, u8, u8],

    Glyphs does not support an alpha channel as of 2.5.1 (confirmed by Georg
    Seifert), and always writes a 1 to it. This was brought up and is probably
    corrected in the next versions.
    https://github.com/googlei18n/glyphsLib/pull/363#issuecomment-390418497