def get_color_for_name(module_name):
<EOL>module_name = module_name.split("<STR_LIT:->")[<NUM_LIT:0>]<EOL>saturation = <NUM_LIT:0.5><EOL>value = <NUM_LIT><EOL>try:<EOL><INDENT>module_name = module_name.encode("<STR_LIT:utf-8>")<EOL><DEDENT>except AttributeError:<EOL><INDENT>pass<EOL><DEDENT>hue = int(md5(module_name).hexdigest(), <NUM_LIT:16>) / <NUM_LIT:16> ** <NUM_LIT:32><EOL>hue *= <NUM_LIT:6><EOL>hue += <NUM_LIT><EOL>r, g, b = (<EOL>(<EOL>value,<EOL>value - value * saturation * abs(<NUM_LIT:1> - hue % <NUM_LIT:2>),<EOL>value - value * saturation,<EOL>)<EOL>* <NUM_LIT:3><EOL>)[<NUM_LIT:5> ** int(hue) // <NUM_LIT:3> % <NUM_LIT:3> :: int(hue) % <NUM_LIT:2> + <NUM_LIT:1>][:<NUM_LIT:3>]<EOL>return "<STR_LIT:#>" + "<STR_LIT>" * <NUM_LIT:3> % (int(r), int(g), int(b))<EOL>
Create a custom color for a given string.
This allows the screenshots to each have a unique color but also for that
color to be consistent.