本文介绍了怎么用CMYK颜色codeS在android系统?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个疑问,我不知道如何在Android的使用CMYK颜色。如果有任何人知道,请帮助我。我在等待您的宝贵答复。

I have an doubt, I don't know how to use cmyk colors in android. If any one knows please help me. I am waiting for your valuable replies.

推荐答案

您只需要一个函数,该函数转换CMYK值RGB?或者,你想一个整体的形象,这是CMYK转换?

You just need a function, which converts the CMYK value to RGB? Or do you want to convert a whole image, which is CMYK?

对于第一个问题,伪code rgb2cmyk:

For the first problem, as pseudocode rgb2cmyk:

int r,g,b,c,m,y,k;
int computedC,computedM,computedY;
int minCMY;

if(r==0 && g==0 && b==0) return {0,0,0,1}

computedC = 1 - (r/255);
computedM = 1 - (g/255);
computedY = 1 - (b/255);

minCMY = Math.min(computedC,Math.min(computedM,computedY));

computedC = (computedC - minCMY) / (1 - minCMY) ;
computedM = (computedM - minCMY) / (1 - minCMY) ;
computedY = (computedY - minCMY) / (1 - minCMY) ;

return {computedC,computedM,computedY,minCMY};

和周围的其他方式,只是计算它向后:)

And for the other way around, just calculate it backwards :)

有关问题没有。 2:
它更容易,因为有一个叫ColorSpace的专用工具:
http://stackoverflow.com/questions/22409/how-do-i-convert-images-between-cmyk-and-rgb-in-coldfusion-java

希望有所帮助:3

这篇关于怎么用CMYK颜色codeS在android系统?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 00:27