+ // // other implementation:
+ //
+ // float a, r, g, b;
+ // a = ((argb & 0xff000000) >> 24) / 255.0f;
+ // r = ((argb & 0x00ff0000) >> 16) / 255.0f;
+ // g = ((argb & 0x0000ff00) >> 8) / 255.0f;
+ // b = ((argb & 0x000000ff)) / 255.0f;
+ //
+ // float rgbMin, rgbMax;
+ // rgbMin = Math.min(r, Math.min(g, b));
+ // rgbMax = Math.max(r, Math.max(g, b));
+ //
+ // float l;
+ // l = (rgbMin + rgbMax) / 2;
+ //
+ // float s;
+ // if (rgbMin == rgbMax) {
+ // s = 0;
+ // } else {
+ // if (l <= 0.5) {
+ // s = (rgbMax - rgbMin) / (rgbMax + rgbMin);
+ // } else {
+ // s = (rgbMax - rgbMin) / (2.0f - rgbMax - rgbMin);
+ // }
+ // }
+ //
+ // float h;
+ // if (r > g && r > b) {
+ // h = (g - b) / (rgbMax - rgbMin);
+ // } else if (g > b) {
+ // h = 2.0f + (b - r) / (rgbMax - rgbMin);
+ // } else {
+ // h = 4.0f + (r - g) / (rgbMax - rgbMin);
+ // }
+ // h /= 6; // from 0 to 1
+ //
+ // return new float[] { h, s, l, a };
+ //
+ // // // natural mode:
+ // //
+ // // int aa = (int) Math.round(100 * a);
+ // // int hh = (int) (360 * h);
+ // // if (hh < 0)
+ // // hh += 360;
+ // // int ss = (int) Math.round(100 * s);
+ // // int ll = (int) Math.round(100 * l);
+ // //
+ // // return new int[] { hh, ss, ll, aa };