kolor.js
function RGBA_TO_CMYK() {
        var r = this.r() / 255;
        var g = this.g() / 255;
        var b = this.b() / 255;
        var black = 1 - Math.max(r, g, b);

        if (black === 0) {
            return kolor.cmyk(0, 0, 0, 0);
        }

        var c = (1 - r - black) / (1 - black);
        var m = (1 - g - black) / (1 - black);
        var y = (1 - b - black) / (1 - black);
        return kolor.cmyk(c, m, y, black, this.a());
    }
function RGBA_TO_CMYK() {
        var r = this.r() / 255;
        var g = this.g() / 255;
        var b = this.b() / 255;
        var black = 1 - Math.max(r, g, b);

        if (black === 0) {
            return kolor.cmyk(0, 0, 0, 0);
        }

        var c = (1 - r - black) / (1 - black);
        var m = (1 - g - black) / (1 - black);
        var y = (1 - b - black) / (1 - black);
        return kolor.cmyk(c, m, y, black, this.a());
    }
function RGBA_TO_CMYK ( ) { var r = this . r ( ) / 255 ; var g = this . g ( ) / 255 ; var b = this . b ( ) / 255 ; var black = 1 - Math . max ( r , g , b ) ; if ( black === 0 ) { return kolor . cmyk ( 0 , 0 , 0 , 0 ) ; } var c = ( 1 - r - black ) / ( 1 - black ) ; var m = ( 1 - g - black ) / ( 1 - black ) ; var y = ( 1 - b - black ) / ( 1 - black ) ; return kolor . cmyk ( c , m , y , black , this . a ( ) ) ; }
Naively converts RGBA color to CMYK
Naively converts RGBA color to CMYK