Convert pixel types to GL constants.

@param p The pixel type.

@return The resulting GL constant.
193798
public static int pixelTypeToGL(
    final JCGLPixelFormat p)
  {
    switch (p) {
      case PIXEL_COMPONENT_BYTE:
        return GL.GL_BYTE;
      case PIXEL_COMPONENT_FLOAT:
        return GL.GL_FLOAT;
      case PIXEL_COMPONENT_INT:
        return GL2ES2.GL_INT;
      case PIXEL_COMPONENT_SHORT:
        return GL.GL_SHORT;
      case PIXEL_COMPONENT_UNSIGNED_BYTE:
        return GL.GL_UNSIGNED_BYTE;
      case PIXEL_COMPONENT_UNSIGNED_INT:
        return GL.GL_UNSIGNED_INT;
      case PIXEL_COMPONENT_UNSIGNED_SHORT:
        return GL.GL_UNSIGNED_SHORT;
      case PIXEL_PACKED_UNSIGNED_INT_1010102:
        return GL2ES2.GL_UNSIGNED_INT_10_10_10_2;
      case PIXEL_PACKED_UNSIGNED_SHORT_4444:
        return GL.GL_UNSIGNED_SHORT_4_4_4_4;
      case PIXEL_PACKED_UNSIGNED_SHORT_5551:
        return GL.GL_UNSIGNED_SHORT_5_5_5_1;
      case PIXEL_PACKED_UNSIGNED_SHORT_565:
        return GL.GL_UNSIGNED_SHORT_5_6_5;
      case PIXEL_COMPONENT_HALF_FLOAT:
        return GL.GL_HALF_FLOAT;
      case PIXEL_PACKED_UNSIGNED_INT_24_8:
        return GL.GL_UNSIGNED_INT_24_8;
    }

    throw new UnreachableCodeException();
  }
805609
@ColorInt
    public static int getAlphaColor(@ColorInt int color, @IntRange(from = 0, to = 255) int alpha) {
        int red = Color.red(color);
        int green = Color.green(color);
        int blue = Color.blue(color);
        return Color.argb(alpha, red, green, blue);
    }
790367
public static int convertDPItoPixels(Context context, int dpi) {
        final float scale = context.getResources().getDisplayMetrics().density;
        return (int) (dpi * scale + 0.5f);
    }
3789
public GVRBitmapTexture getSolidColorTexture(int color) {
        GVRBitmapTexture texture;
        synchronized (mColorTextureCache) {
            texture = mColorTextureCache.get(color);
            Log.d(TAG, "getSolidColorTexture(): have cached texture for 0x%08X: %b", color, texture != null);
            if (texture == null) {
                texture = new ImmutableBitmapTexture(mContext, makeSolidColorBitmap(color));
                Log.d(TAG, "getSolidColorTexture(): caching texture for 0x%08X", color);
                mColorTextureCache.put(color, texture);
                Log.d(TAG, "getSolidColorTexture(): succeeded caching for 0x%08X: %b",
                        color, mColorTextureCache.indexOfKey(color) >= 0);
            }
        }

        return texture;
    }
1108244
public int filterRGB(int pX, int pY, int pARGB) {
        // Get color components
        int r = pARGB >> 16 & 0xFF;
        int g = pARGB >>  8 & 0xFF;
        int b = pARGB       & 0xFF;

        // ITU standard:  Gray scale=(222*Red+707*Green+71*Blue)/1000
        int gray = (222 * r + 707 * g + 71 * b) / 1000;

        //int gray = (int) ((float) (r + g + b) / 3.0f);

        if (range != 1.0f) {
            // Apply range
            gray =  low + (int) (gray * range);
        }

        // Return ARGB pixel
        return  (pARGB & 0xFF000000) | (gray << 16) | (gray << 8) | gray;
    }
936118
public void interpolateColorValue( ByteBuffer cmapBuffer, float cell ) {
        cmapBuffer.put(Float.isNaN(cell) ? blank : getColor(cell));
    }
830499
public void glTexImage2D(int target, int i, int dstPixelFormat,
			int width, int height, int j, int srcPixelFormat,
			int glUnsignedByte, ByteBuffer textureBuffer) {
		GL11.glTexImage2D(target, i, dstPixelFormat, width, height, j, srcPixelFormat,glUnsignedByte,textureBuffer);						  
	}
256769
public String parsePackageName(PackageElement p) {
        String pkgname = p.isUnnamed() ? "" : getPackageName(p);
        int index = -1;
        for (int j = 0; j < MAX_CONSTANT_VALUE_INDEX_LENGTH; j++) {
            index = pkgname.indexOf(".", index + 1);
        }
        if (index != -1) {
            pkgname = pkgname.substring(0, index);
        }
        return pkgname;
    }
1289109
public static JCGLBlendFunction blendFunctionFromGL(
    final int type)
  {
    switch (type) {
      case GL2ES2.GL_CONSTANT_ALPHA:
        return JCGLBlendFunction.BLEND_CONSTANT_ALPHA;
      case GL2ES2.GL_CONSTANT_COLOR:
        return JCGLBlendFunction.BLEND_CONSTANT_COLOR;
      case GL.GL_DST_ALPHA:
        return JCGLBlendFunction.BLEND_DESTINATION_ALPHA;
      case GL.GL_DST_COLOR:
        return JCGLBlendFunction.BLEND_DESTINATION_COLOR;
      case GL.GL_ONE:
        return JCGLBlendFunction.BLEND_ONE;
      case GL2ES2.GL_ONE_MINUS_CONSTANT_ALPHA:
        return JCGLBlendFunction.BLEND_ONE_MINUS_CONSTANT_ALPHA;
      case GL2ES2.GL_ONE_MINUS_CONSTANT_COLOR:
        return JCGLBlendFunction.BLEND_ONE_MINUS_CONSTANT_COLOR;
      case GL.GL_ONE_MINUS_DST_ALPHA:
        return JCGLBlendFunction.BLEND_ONE_MINUS_DESTINATION_ALPHA;
      case GL.GL_ONE_MINUS_DST_COLOR:
        return JCGLBlendFunction.BLEND_ONE_MINUS_DESTINATION_COLOR;
      case GL.GL_ONE_MINUS_SRC_ALPHA:
        return JCGLBlendFunction.BLEND_ONE_MINUS_SOURCE_ALPHA;
      case GL.GL_ONE_MINUS_SRC_COLOR:
        return JCGLBlendFunction.BLEND_ONE_MINUS_SOURCE_COLOR;
      case GL.GL_SRC_ALPHA:
        return JCGLBlendFunction.BLEND_SOURCE_ALPHA;
      case GL.GL_SRC_COLOR:
        return JCGLBlendFunction.BLEND_SOURCE_COLOR;
      case GL.GL_SRC_ALPHA_SATURATE:
        return JCGLBlendFunction.BLEND_SOURCE_ALPHA_SATURATE;
      case GL.GL_ZERO:
        return JCGLBlendFunction.BLEND_ZERO;
      default:
        throw new UnreachableCodeException();
    }
  }
953881
static double luminance( double color ) {
        long argb = Double.doubleToRawLongBits( color );
        double r = ((argb >> 32) & 0xFFFF) / (double)0xFF00;
        double g = ((argb >> 16) & 0xFFFF) / (double)0xFF00;
        double b = ((argb) & 0xFFFF) / (double)0xFF00;
        return (0.2126 * r) + (0.7152 * g) + (0.0722 * b);
    }
1148354
public static boolean approx(Color color, int tolerance, Pixel[] pixels) {

        RGBColor refColor = color.toRGB();

        RGBColor minColor = new RGBColor(
                Math.max(refColor.red() - tolerance, 0),
                Math.max(refColor.green() - tolerance, 0),
                Math.max(refColor.blue() - tolerance, 0),
                refColor.alpha()
        );

        RGBColor maxColor = new RGBColor(
                Math.min(refColor.red() + tolerance, 255),
                Math.min(refColor.green() + tolerance, 255),
                Math.min(refColor.blue() + tolerance, 255),
                refColor.alpha()
        );

        return Arrays.stream(pixels).allMatch(p -> p.toInt() >= minColor.toInt() && p.toInt() <= maxColor.toInt());
    }
968714
public static int unsignedTypeToGL(
    final JCGLUnsignedType type)
  {
    switch (type) {
      case TYPE_UNSIGNED_BYTE:
        return GL11.GL_UNSIGNED_BYTE;
      case TYPE_UNSIGNED_SHORT:
        return GL11.GL_UNSIGNED_SHORT;
      case TYPE_UNSIGNED_INT:
        return GL11.GL_UNSIGNED_INT;
    }

    throw new UnreachableCodeException();
  }
886439
private static long getRgbFromColorConst( String str ) {
        long rgb;
        switch( str ) {
            case "aliceblue":
                rgb = 0xf000_f800_ff00L;
                break;
            case "antiquewhite":
                rgb = 0xfa00_eb00_d700L;
                break;
            case "aqua":
                rgb = 0xff00_ff00L;
                break;
            case "aquamarine":
                rgb = 0x7f00_ff00_d400L;
                break;
            case "azure":
                rgb = 0xf000_ff00_ff00L;
                break;
            case "beige":
                rgb = 0xf500_f500_dc00L;
                break;
            case "bisque":
                rgb = 0xff00_e400_c400L;
                break;
            case "black":
                rgb = 0x00;
                break;
            case "blanchedalmond":
                rgb = 0xff00_eb00_cd00L;
                break;
            case "blue":
                rgb = 0xFF00L;
                break;
            case "blueviolet":
                rgb = 0x8a00_2b00_e200L;
                break;
            case "brown":
                rgb = 0xa500_2a00_2a00L;
                break;
            case "burlywood":
                rgb = 0xde00_b800_8700L;
                break;
            case "cadetblue":
                rgb = 0x5f00_9e00_a000L;
                break;
            case "chartreuse":
                rgb = 0x7f00_ff00_0000L;
                break;
            case "chocolate":
                rgb = 0xd200_6900_1e00L;
                break;
            case "coral":
                rgb = 0xff00_7f00_5000L;
                break;
            case "cornflowerblue":
                rgb = 0x6400_9500_ed00L;
                break;
            case "cornsilk":
                rgb = 0xff00_f800_dc00L;
                break;
            case "crimson":
                rgb = 0xdc00_1400_3c00L;
                break;
            case "cyan":
                rgb = 0x0000_ff00_ff00L;
                break;
            case "darkblue":
                rgb = 0x0000_0000_8b00L;
                break;
            case "darkcyan":
                rgb = 0x0000_8b00_8b00L;
                break;
            case "darkgoldenrod":
                rgb = 0xb800_8600_0b00L;
                break;
            case "darkgray":
            case "darkgrey": //British
                rgb = 0xa900_a900_a900L;
                break;
            case "darkgreen":
                rgb = 0x0000_6400_0000L;
                break;
            case "darkkhaki":
                rgb = 0xbd00_b700_6b00L;
                break;
            case "darkmagenta":
                rgb = 0x8b00_0000_8b00L;
                break;
            case "darkolivegreen":
                rgb = 0x5500_6b00_2f00L;
                break;
            case "darkorange":
                rgb = 0xff00_8c00_0000L;
                break;
            case "darkorchid":
                rgb = 0x9900_3200_cc00L;
                break;
            case "darkred":
                rgb = 0x8b00_0000_0000L;
                break;
            case "darksalmon":
                rgb = 0xe900_9600_7a00L;
                break;
            case "darkseagreen":
                rgb = 0x8f00_bc00_8f00L;
                break;
            case "darkslateblue":
                rgb = 0x4800_3d00_8b00L;
                break;
            case "darkslategray":
            case "darkslategrey": //British
                rgb = 0x2f00_4f00_4f00L;
                break;
            case "darkturquoise":
                rgb = 0x0000_ce00_d100L;
                break;
            case "darkviolet":
                rgb = 0x9400_0000_d300L;
                break;
            case "deeppink":
                rgb = 0xff00_1400_9300L;
                break;
            case "deepskyblue":
                rgb = 0x0000_bf00_ff00L;
                break;
            case "dimgray":
            case "dimgrey": //British
                rgb = 0x6900_6900_6900L;
                break;
            case "dodgerblue":
                rgb = 0x1e00_9000_ff00L;
                break;
            case "firebrick":
                rgb = 0xb200_2200_2200L;
                break;
            case "floralwhite":
                rgb = 0xff00_fa00_f000L;
                break;
            case "forestgreen":
                rgb = 0x2200_8b00_2200L;
                break;
            case "fuchsia":
                rgb = 0xff00_0000_ff00L;
                break;
            case "gainsboro":
                rgb = 0xdc00_dc00_dc00L;
                break;
            case "ghostwhite":
                rgb = 0xf800_f800_ff00L;
                break;
            case "gold":
                rgb = 0xff00_d700_0000L;
                break;
            case "goldenrod":
                rgb = 0xda00_a500_2000L;
                break;
            case "gray":
            case "grey": //British
                rgb = 0x8000_8000_8000L;
                break;
            case "green":
                rgb = 0x0000_8000_0000L;
                break;
            case "greenyellow":
                rgb = 0xad00_ff00_2f00L;
                break;
            case "honeydew":
                rgb = 0xf000_ff00_f000L;
                break;
            case "hotpink":
                rgb = 0xff00_6900_b400L;
                break;
            case "indianred":
                rgb = 0xcd00_5c00_5c00L;
                break;
            case "indigo":
                rgb = 0x4b00_0000_8200L;
                break;
            case "ivory":
                rgb = 0xff00_ff00_f000L;
                break;
            case "khaki":
                rgb = 0xf000_e600_8c00L;
                break;
            case "lavender":
                rgb = 0xe600_e600_fa00L;
                break;
            case "lavenderblush":
                rgb = 0xff00_f000_f500L;
                break;
            case "lawngreen":
                rgb = 0x7c00_fc00_0000L;
                break;
            case "lemonchiffon":
                rgb = 0xff00_fa00_cd00L;
                break;
            case "lightblue":
                rgb = 0xad00_d800_e600L;
                break;
            case "lightcoral":
                rgb = 0xf000_8000_8000L;
                break;
            case "lightcyan":
                rgb = 0xe000_ff00_ff00L;
                break;
            case "lightgoldenrodyellow":
                rgb = 0xfa00_fa00_d200L;
                break;
            case "lightgray":
            case "lightgrey": //British
                rgb = 0xd300_d300_d300L;
                break;
            case "lightgreen":
                rgb = 0x9000_ee00_9000L;
                break;
            case "lightpink":
                rgb = 0xff00_b600_c100L;
                break;
            case "lightsalmon":
                rgb = 0xff00_a000_7a00L;
                break;
            case "lightseagreen":
                rgb = 0x2000_b200_aa00L;
                break;
            case "lightskyblue":
                rgb = 0x8700_ce00_fa00L;
                break;
            case "lightslategray":
            case "lightslategrey": //British
                rgb = 0x7700_8800_9900L;
                break;
            case "lightsteelblue":
                rgb = 0xb000_c400_de00L;
                break;
            case "lightyellow":
                rgb = 0xff00_ff00_e000L;
                break;
            case "lime":
                rgb = 0x0000_ff00_0000L;
                break;
            case "limegreen":
                rgb = 0x3200_cd00_3200L;
                break;
            case "linen":
                rgb = 0xfa00_f000_e600L;
                break;
            case "magenta":
                rgb = 0xff00_0000_ff00L;
                break;
            case "maroon":
                rgb = 0x8000_0000_0000L;
                break;
            case "mediumaquamarine":
                rgb = 0x6600_cd00_aa00L;
                break;
            case "mediumblue":
                rgb = 0x0000_0000_cd00L;
                break;
            case "mediumorchid":
                rgb = 0xba00_5500_d300L;
                break;
            case "mediumpurple":
                rgb = 0x9300_7000_d800L;
                break;
            case "mediumseagreen":
                rgb = 0x3c00_b300_7100L;
                break;
            case "mediumslateblue":
                rgb = 0x7b00_6800_ee00L;
                break;
            case "mediumspringgreen":
                rgb = 0x0000_fa00_9a00L;
                break;
            case "mediumturquoise":
                rgb = 0x4800_d100_cc00L;
                break;
            case "mediumvioletred":
                rgb = 0xc700_1500_8500L;
                break;
            case "midnightblue":
                rgb = 0x1900_1900_7000L;
                break;
            case "mintcream":
                rgb = 0xf500_ff00_fa00L;
                break;
            case "mistyrose":
                rgb = 0xff00_e400_e100L;
                break;
            case "moccasin":
                rgb = 0xff00_e400_b500L;
                break;
            case "navajowhite":
                rgb = 0xff00_de00_ad00L;
                break;
            case "navy":
                rgb = 0x8000L;
                break;
            case "oldlace":
                rgb = 0xfd00_f500_e600L;
                break;
            case "olive":
                rgb = 0x8000_8000_0000L;
                break;
            case "olivedrab":
                rgb = 0x6b00_8e00_2300L;
                break;
            case "orange":
                rgb = 0xff00_a500_0000L;
                break;
            case "orangered":
                rgb = 0xff00_4500_0000L;
                break;
            case "orchid":
                rgb = 0xda00_7000_d600L;
                break;
            case "palegoldenrod":
                rgb = 0xee00_e800_aa00L;
                break;
            case "palegreen":
                rgb = 0x9800_fb00_9800L;
                break;
            case "paleturquoise":
                rgb = 0xaf00_ee00_ee00L;
                break;
            case "palevioletred":
                rgb = 0xd800_7000_9300L;
                break;
            case "papayawhip":
                rgb = 0xff00_ef00_d500L;
                break;
            case "peachpuff":
                rgb = 0xff00_da00_b900L;
                break;
            case "peru":
                rgb = 0xcd00_8500_3f00L;
                break;
            case "pink":
                rgb = 0xff00_c000_cb00L;
                break;
            case "plum":
                rgb = 0xdd00_a000_dd00L;
                break;
            case "powderblue":
                rgb = 0xb000_e000_e600L;
                break;
            case "purple":
                rgb = 0x8000_0000_8000L;
                break;
            case "red":
                rgb = 0xFF00_0000_0000L;
                break;
            case "rosybrown":
                rgb = 0xbc00_8f00_8f00L;
                break;
            case "royalblue":
                rgb = 0x4100_6900_e100L;
                break;
            case "saddlebrown":
                rgb = 0x8b00_4500_1300L;
                break;
            case "salmon":
                rgb = 0xfa00_8000_7200L;
                break;
            case "sandybrown":
                rgb = 0xf400_a400_6000L;
                break;
            case "seagreen":
                rgb = 0x2e00_8b00_5700L;
                break;
            case "seashell":
                rgb = 0xff00_f500_ee00L;
                break;
            case "sienna":
                rgb = 0xa000_5200_2d00L;
                break;
            case "silver":
                rgb = 0xc000_c000_c000L;
                break;
            case "skyblue":
                rgb = 0x8700_ce00_eb00L;
                break;
            case "slateblue":
                rgb = 0x6a00_5a00_cd00L;
                break;
            case "slategray":
            case "slategrey": //British
                rgb = 0x7000_8000_9000L;
                break;
            case "snow":
                rgb = 0xff00_fa00_fa00L;
                break;
            case "springgreen":
                rgb = 0x0000_ff00_7f00L;
                break;
            case "steelblue":
                rgb = 0x4600_8200_b400L;
                break;
            case "tan":
                rgb = 0xd200_b400_8c00L;
                break;
            case "teal":
                rgb = 0x0000_8000_8000L;
                break;
            case "thistle":
                rgb = 0xd800_bf00_d800L;
                break;
            case "tomato":
                rgb = 0xff00_6300_4700L;
                break;
            case "turquoise":
                rgb = 0x4000_e000_d000L;
                break;
            case "violet":
                rgb = 0xee00_8200_ee00L;
                break;
            case "wheat":
                rgb = 0xf500_de00_b300L;
                break;
            case "white":
                rgb = 0xFF00_FF00_FF00L;
                break;
            case "whitesmoke":
                rgb = 0xf500_f500_f500L;
                break;
            case "yellow":
                rgb = 0xff00_ff00_0000L;
                break;
            case "yellowgreen":
                rgb = 0x9a00_cd00_3200L;
                break;
            default:
                rgb = -1;
        }
        return rgb;
    }
1061175
public static JCGLUsageHint usageHintFromGL(
    final int hint)
  {
    switch (hint) {
      case GL15.GL_DYNAMIC_COPY:
        return JCGLUsageHint.USAGE_DYNAMIC_COPY;
      case GL15.GL_DYNAMIC_DRAW:
        return JCGLUsageHint.USAGE_DYNAMIC_DRAW;
      case GL15.GL_DYNAMIC_READ:
        return JCGLUsageHint.USAGE_DYNAMIC_READ;
      case GL15.GL_STATIC_COPY:
        return JCGLUsageHint.USAGE_STATIC_COPY;
      case GL15.GL_STATIC_DRAW:
        return JCGLUsageHint.USAGE_STATIC_DRAW;
      case GL15.GL_STATIC_READ:
        return JCGLUsageHint.USAGE_STATIC_READ;
      case GL15.GL_STREAM_COPY:
        return JCGLUsageHint.USAGE_STREAM_COPY;
      case GL15.GL_STREAM_DRAW:
        return JCGLUsageHint.USAGE_STREAM_DRAW;
      case GL15.GL_STREAM_READ:
        return JCGLUsageHint.USAGE_STREAM_READ;
      default:
        throw new UnreachableCodeException();
    }
  }
758165
function shadeBlendConvert(p, from, to) {
    if (typeof (p) != "number" || p < -1 || p > 1 || typeof (from) != "string" || (from[0] != 'r' && from[0] != '#') || (typeof (to) != "string" && typeof (to) != "undefined")) {
        return null; //ErrorCheck
    }
    var sbcRip = function (d) {
        var l = d.length, RGB = new Object();
        if (l > 9) {
            d = d.split(",");
            if (d.length < 3 || d.length > 4)
                return null; //ErrorCheck
            RGB[0] = i(d[0].slice(4)), RGB[1] = i(d[1]), RGB[2] = i(d[2]), RGB[3] = d[3] ? parseFloat(d[3]) : -1;
        }
        else {
            switch (l) {
                case 8:
                case 6:
                case 3:
                case 2:
                case 1: return null;
            } //ErrorCheck
            if (l < 6)
                d = "#" + d[1] + d[1] + d[2] + d[2] + d[3] + d[3] + (l > 4 ? d[4] + "" + d[4] : ""); //3 digit
            d = i(d.slice(1), 16), RGB[0] = d >> 16 & 255, RGB[1] = d >> 8 & 255, RGB[2] = d & 255, RGB[3] = l == 9 || l == 5 ? r(((d >> 24 & 255) / 255) * 10000) / 10000 : -1;
        }
        return RGB;
    };
    var i = parseInt, r = Math.round, h = from.length > 9, h = typeof (to) == "string" ? to.length > 9 ? true : to == "c" ? !h : false : h, b = p < 0, p = b ? p * -1 : p, to = to && to != "c" ? to : b ? "#000000" : "#FFFFFF", f = sbcRip(from), t = sbcRip(to);
    if (!f || !t)
        return null; //ErrorCheck
    if (h)
        return "rgb(" + r((t[0] - f[0]) * p + f[0]) + "," + r((t[1] - f[1]) * p + f[1]) + "," + r((t[2] - f[2]) * p + f[2]) + (f[3] < 0 && t[3] < 0 ? ")" : "," + (f[3] > -1 && t[3] > -1 ? r(((t[3] - f[3]) * p + f[3]) * 10000) / 10000 : t[3] < 0 ? f[3] : t[3]) + ")");
    else
        return "#" + (0x100000000 + (f[3] > -1 && t[3] > -1 ? r(((t[3] - f[3]) * p + f[3]) * 255) : t[3] > -1 ? r(t[3] * 255) : f[3] > -1 ? r(f[3] * 255) : 255) * 0x1000000 + r((t[0] - f[0]) * p + f[0]) * 0x10000 + r((t[1] - f[1]) * p + f[1]) * 0x100 + r((t[2] - f[2]) * p + f[2])).toString(16).slice(f[3] > -1 || t[3] > -1 ? 1 : 3);
}
1220617
public EquivalentParameter convert(Parameter p) {
        if (p == null) return null;
        return paramCvtr.convert(p);
    }
770370
public static float[] cmykFromRgb(int rgbColor) {
        int red = (0xff0000 & rgbColor) >> 16;
        int green = (0xff00 & rgbColor) >> 8;
        int blue = (0xff & rgbColor);
        float black = Math.min(1.0f - red / 255.0f, Math.min(1.0f - green / 255.0f, 1.0f - blue / 255.0f));
        float cyan = 1.0f;
        float magenta = 1.0f;
        float yellow = 1.0f;
        if (black != 1.0f) {
            // black 1.0 causes zero divide
            cyan = (1.0f - (red / 255.0f) - black) / (1.0f - black);
            magenta = (1.0f - (green / 255.0f) - black) / (1.0f - black);
            yellow = (1.0f - (blue / 255.0f) - black) / (1.0f - black);
        }
        return new float[]{cyan, magenta, yellow, black};
    }