import hashlib


def hash_color(input_string):
	"""
	Derives a hex color code from the MD5 hash of an input string.
	Returns the resulting hex color code as a string.
	"""
	digest_chars = list(hashlib.md5(input_string).hexdigest())
	color = ""
	while len(color) < 6:
		color += digest_chars.pop(0)
		color += digest_chars.pop(-1)
	return color