def convert_to_hsl(word,force_alpha = False):

	hex_re = re.compile('#((?:[\da-f]{3}){1,2})', re.IGNORECASE)
	rgb_re = re.compile('rgba?\(([\d, \%\.]+)\)', re.IGNORECASE)

	hex_match = hex_re.match(word)
	rgb_match = rgb_re.match(word)

	if hex_match:
		hex_color = hex_match.group(1)

		if len(hex_color) == 6:
			r,g,b = tuple(int(hex_color[i:i+2], 16) for i in range(0, 6, 2))
		else:
			r,g,b = tuple(int(hex_color[i:i+1], 16)*17 for i in range(0, 3))
		if force_alpha:
			return rgb_to_hsl(r,g,b,1)
		else:
			return rgb_to_hsl(r,g,b)



	elif rgb_match:
		rgb_list = rgb_match.group(1).split(",")
		rgb_list_len = len(rgb_list)

		if 3 <= 4 <= rgb_list_len:
			r,g,b = list(map(get_decimal,rgb_list[0:3]))

			if rgb_list_len == 4:
				a = rgb_list[3].strip()
			elif force_alpha:
				a = 1
			else:
				a = None

			return rgb_to_hsl(r,g,b,a)

	# return True
dataset/ETHPy150Open atadams/Hex-to-HSL-Color/RGB-to-HSL-color.py/convert_to_hsl/swapped operands of `<=`