kolor.js
function RGBA_TO_HSLA() {
        var r = this.r() / 255;
        var g = this.g() / 255;
        var b = this.b() / 255;
        var a = this.a();
        var max = Math.max(r, g, b);
        var min = Math.min(r, g, b);
        var diff = max - min;
        var sum = max + min;
        var h;
        var s;
        var l;

        if (max === min) {
            h = 0;
        } else if (max === r && g >= b) {
            h = 60 * (g - b) / diff + 0;
        } else if (max === r && g < b) {
            h = 60 * (g - b) / diff + 360;
        } else if (max === g) {
            h = 60 * (b - r) / diff + 120;
        } else { // max === b
            h = 60 * (r - g) / diff + 240;
        }

        l = sum / 2;

        if (l === 0 || max === min) {
            s = 0;
        } else if (0 < l && l <= 0.5) {
            s = diff / sum;
        } else { // l > 0.5
            s = diff / (2 - sum);
        }

        return kolor.hsla(h, s, l, a);
    }
function RGBA_TO_HSLA() {
        var r = this.r() / 255;
        var g = this.g() / 255;
        var b = this.b() / 255;
        var a = this.a();
        var max = Math.max(r, g, b);
        var min = Math.min(r, g, b);
        var diff = max - min;
        var sum = max + min;
        var h;
        var s;
        var l;

        if (max === min) {
            h = 0;
        } else if (max === r && g >= b) {
            h = 60 * (g - b) / diff + 0;
        } else if (max === r && g < b) {
            h = 60 * (g - b) / diff + 360;
        } else if (max === g) {
            h = 60 * (b - r) / diff + 120;
        } else { // max === b
            h = 60 * (r - g) / diff + 240;
        }

        l = sum / 2;

        if (l === 0 || max === min) {
            s = 0;
        } else if (0 < l && l <= 0.5) {
            s = diff / sum;
        } else { // l > 0.5
            s = diff / (2 - sum);
        }

        return kolor.hsla(h, s, l, a);
    }
function RGBA_TO_HSLA ( ) { var r = this . r ( ) / 255 ; var g = this . g ( ) / 255 ; var b = this . b ( ) / 255 ; var a = this . a ( ) ; var max = Math . max ( r , g , b ) ; var min = Math . min ( r , g , b ) ; var diff = max - min ; var sum = max + min ; var h ; var s ; var l ; if ( max === min ) { h = 0 ; } else if ( max === r && g >= b ) { h = 60 * ( g - b ) / diff + 0 ; } else if ( max === r && g < b ) { h = 60 * ( g - b ) / diff + 360 ; } else if ( max === g ) { h = 60 * ( b - r ) / diff + 120 ; } else { // max === b
 h = 60 * ( r - g ) / diff + 240 ; } l = sum / 2 ; if ( l === 0 || max === min ) { s = 0 ; } else if ( 0 < l && l <= 0.5 ) { s = diff / sum ; } else { // l > 0.5
 s = diff / ( 2 - sum ) ; } return kolor . hsla ( h , s , l , a ) ; }
Converts RGBA color to HSLA.
Converts RGBA color to HSLA .