Пример #1
0
	def processRGB(self,r,g,b):
		RGB = COLORB()
		RGB[0] = int(round(r, 3)*255)
		RGB[1] = int(round(g, 3)*255)
		RGB[2] = int(round(b, 3)*255)
		
		outRGB = COLORB()
		outRGB[0] = 0
		outRGB[1] = 0
		outRGB[2] = 0		
		cmsDoTransform(self.rgb_monitor, RGB, outRGB, 1)
		
		return round(outRGB[0]/255.0, 3), round(outRGB[1]/255.0, 3), round(outRGB[2]/255.0, 3)
Пример #2
0
	def processCMYK(self,c,m,y,k):
		CMYK = COLORB()
		CMYK[0] = int(round(c, 3)*255)
		CMYK[1] = int(round(m, 3)*255)
		CMYK[2] = int(round(y, 3)*255)
		CMYK[3] = int(round(k, 3)*255)
		
		outRGB = COLORB()
		outRGB[0] = 0
		outRGB[1] = 0
		outRGB[2] = 0	
		cmsDoTransform(self.cmyk_rgb, CMYK, outRGB, 1)
		
		return round(outRGB[0]/255.0, 3), round(outRGB[1]/255.0, 3), round(outRGB[2]/255.0, 3)
Пример #3
0
	def convertRGB(self,r,g,b):
		RGB = COLORB()
		RGB[0] = int(round(r, 3)*255)
		RGB[1] = int(round(g, 3)*255)
		RGB[2] = int(round(b, 3)*255)
		
		CMYK = COLORB()
		CMYK[0] = 0
		CMYK[1] = 0
		CMYK[2] = 0
		CMYK[3] = 0
		cmsDoTransform(self.rgb_cmyk, RGB, CMYK, 1)
		
		return round(CMYK[0]/255.0, 3), round(CMYK[1]/255.0, 3), round(CMYK[2]/255.0, 3), round(CMYK[3]/255.0, 3)
Пример #4
0
    def processRGB(self, r, g, b):
        RGB = COLORB()
        RGB[0] = int(round(r, 3) * 255)
        RGB[1] = int(round(g, 3) * 255)
        RGB[2] = int(round(b, 3) * 255)

        outRGB = COLORB()
        outRGB[0] = 0
        outRGB[1] = 0
        outRGB[2] = 0
        cmsDoTransform(self.rgb_monitor, RGB, outRGB, 1)

        return round(outRGB[0] / 255.0,
                     3), round(outRGB[1] / 255.0,
                               3), round(outRGB[2] / 255.0, 3)
Пример #5
0
    def processCMYK(self, c, m, y, k):
        CMYK = COLORB()
        CMYK[0] = int(round(c, 3) * 255)
        CMYK[1] = int(round(m, 3) * 255)
        CMYK[2] = int(round(y, 3) * 255)
        CMYK[3] = int(round(k, 3) * 255)

        outRGB = COLORB()
        outRGB[0] = 0
        outRGB[1] = 0
        outRGB[2] = 0
        cmsDoTransform(self.cmyk_rgb, CMYK, outRGB, 1)

        return round(outRGB[0] / 255.0,
                     3), round(outRGB[1] / 255.0,
                               3), round(outRGB[2] / 255.0, 3)
Пример #6
0
    def convertRGB(self, r, g, b):
        RGB = COLORB()
        RGB[0] = int(round(r, 3) * 255)
        RGB[1] = int(round(g, 3) * 255)
        RGB[2] = int(round(b, 3) * 255)

        CMYK = COLORB()
        CMYK[0] = 0
        CMYK[1] = 0
        CMYK[2] = 0
        CMYK[3] = 0
        cmsDoTransform(self.rgb_cmyk, RGB, CMYK, 1)

        return round(CMYK[0] / 255.0,
                     3), round(CMYK[1] / 255.0,
                               3), round(CMYK[2] / 255.0,
                                         3), round(CMYK[3] / 255.0, 3)