I have a numpy array-an 2D numpy array of [H, S, L] for each pixel-and I want to convert these into rgb variables. There wasn't a hsl-rgb converter in matplotlib.colors and I couldn't find a converter that uses arrays as a input. So I had to make it myself. I found a conversion equation here. Everything was okay except that I got stuck implementing the if's.
Can I get help either making the if's statement or finding a function that converts a rsl array to rgb array?
Here's my conversion function I currently made.
def hsl2rgb(self,H,S,L):
C = np.multiply(1-np.abs(2*L-1),S)
X = np.multply(C, 1 - np.abs(np.mod(H*6,2)-1))
m = np.subtract(L, C/2)
h=np.floor(6*H)