def rgb2Lab(self, RGB):
        """
        Conversion of RGB to CIELAB
        """

        # convert RGB to XYZ
        X, Y, Z = (self.rgb2xyz(RGB)).tolist()

        # helper function
        def f(x):
            limit = 0.008856
            if x> limit:
                return np.power(x, 1./3.)
            else:
                return 7.787*x + 16./116.

        # calculation of L, a and b
        L = 116. * ( f(Y/self.Yn) - (16./116.) )
        a = 500. * ( f(X/self.Xn) - f(Y/self.Yn) )
        b = 200. * ( f(Y/self.Yn) - f(Z/self.Zn) )
        return np.array([L, a, b])
    #-
dataset/ETHPy150Open ethankruse/kepler_orrery/diverging_map.py/ColorMapCreator.rgb2Lab/original