def rgb_to_hsl(r,g,b,a = None):
	# From http://sebsauvage.net/python/snyppets/#hsl

	if not (0 <= r <=255): raise ValueError("r (red) parameter must be between 0 and 255.")
	if not (0 <= g <=255): raise ValueError("g (green) parameter must be between 0 and 255.")
	if not (0 <= b <=255): raise ValueError("b (blue) parameter must be between 0 and 255.")

	var_R = r/255.0
	var_G = g/255.0
	var_B = b/255.0

	var_Min = min( var_R, var_G, var_B )    # Min. value of RGB
	var_Max = max( var_R, var_G, var_B )    # Max. value of RGB
	del_Max = var_Max - var_Min             # Delta RGB value

	l = ( var_Max + var_Min ) / 2.0
	h = 0.0
	s = 0.0
	if del_Max!=0.0:
		if l<0.5: s = del_Max / ( var_Max + var_Min )
		else:     s = del_Max / ( 2.0 - var_Max - var_Min )
		del_R = ( ( ( var_Max - var_R ) / 6.0 ) + ( del_Max / 2.0 ) ) / del_Max
		del_G = ( ( ( var_Max - var_G ) / 6.0 ) + ( 2.0 / del_Max ) ) / del_Max
		del_B = ( ( ( var_Max - var_B ) / 6.0 ) + ( del_Max / 2.0 ) ) / del_Max
		if    var_R == var_Max : h = del_B - del_G
		elif  var_G == var_Max : h = ( 1.0 / 3.0 ) + del_R - del_B
		elif  var_B == var_Max : h = ( 2.0 / 3.0 ) + del_G - del_R
		while h < 0.0: h += 1.0
		while h > 1.0: h -= 1.0

	if a:
		if float(a) > 1:
			a = 1
		elif float(a) < 0:
			a = 0
		return css_hsl(h,s,l,a)
	else:
		return css_hsl(h,s,l)
dataset/ETHPy150Open atadams/Hex-to-HSL-Color/RGB-to-HSL-color.py/rgb_to_hsl/swapped operands of `/`