は、ここで私はあなたが輝度Yと色座標x、yの渡しWikipediaのページhttp://en.wikipedia.org/wiki/SRGB_color_space
private int makeARGB(double Y, double x, double y) {
// Out of gamut colour
int rgb = 0xFF808080;
double X = Y * x/y;
double Z = Y * (1 - x - y)/y;
double rlin = +3.2046 * X + -1.5372 * Y + -0.4986 * Z;
double r = gamma(rlin);
int ir = (int) (r * 255.0);
if (ir >= 0 && ir < 256) {
double glin = -0.9689 * X + +1.8758 * Y + +0.0415 * Z;
double g = gamma(glin);
int ig = (int) (g * 255.0);
if (ig >= 0 && ig < 256) {
double blin = +0.0557 * X + -0.2040 * Y + +1.0570 * Z;
double b = gamma(blin);
int ib = (int) (b * 255.0);
if (ib >= 0 && ib < 256) {
rgb = 0xFF000000 + (ir << 16) + (ig << 8) + (ib << 0);
}
}
}
return rgb;
}
private double gamma(double l) {
if (l < 0.0031308) {
return l * 12.92;
} else {
return 1.055 * Math.pow(l, 1.0/2.4) - 0.055;
}
}
private BufferedImage createImage() {
BufferedImage bm = new BufferedImage(256, 256, BufferedImage.TYPE_INT_ARGB);
for (int ix = 0; ix < bm.getWidth(); ++ix) {
double astar = ((double) ix)/((double) bm.getWidth());
for (int iy = 1; iy < bm.getHeight(); ++iy) {
double bstar = ((double) iy)/((double) bm.getHeight());
int rgb = makeARGB(0.3, astar, bstar);
bm.setRGB(ix, iy, rgb);
}
}
return bm;
}
を見てから、ちょうど今書いた少し機能です。 xとyは公称0..1からですが、その 'スペース'の多くはsRGB色域にはないので、表示可能な色には対応しません。 Yも0..1であり、最初に0.3..0.5を試す。
例の画像:
私は、GoogleのApp Engineについては何も知らないが、ARGBの整数は、必要な色指定の一種でありますか?
ラボの色空間を考慮しましたか? – Rekin
はい、有望です。しかし、私はそれにもう少し時間をかけなければならないでしょう。私は解決策を探しているので、このトピックについてもっと時間を費やす必要はありません。 – hakunin
ほとんどの場合、輝度を使用してチャートなどの赤と緑の色合いを区別する、色盲の人にとって使い勝手の悪夢を作り出していることに注意してください。 – ddimitrov