class ColorUtilities {

    public static String convertToHexString(Color color, int redIndex, int greenIndex, int blueIndex)
    {
        int inputVal = color.getRGB();

        int outputVal = 0;

        outputVal |= MathUtil.byteShift(inputVal & 0x00ff0000, 0 - redIndex);
        outputVal |= MathUtil.byteShift(inputVal & 0x0000ff00, 1 - greenIndex);
        outputVal |= MathUtil.byteShift(inputVal & 0x000000ff, 2 - blueIndex);

        return Integer.toHexString(outputVal);
    }

    private  ColorUtilities();

}