hi again

a little assistance regarding converting hex to PDColor.

please take this example #ff8000

and this is my code

String colorStr = "#ff8000";
java.awt.Color rgb = new java.awt.Color(
            Integer.valueOf(colorStr.substring(1, 3), 16),
            Integer.valueOf(colorStr.substring(3, 5), 16),
            Integer.valueOf(colorStr.substring(5, 7), 16))

PDColor pdcolor = new PDColor(new float[] { rgb.getRed() / 255,
rgb.getGreen() / 255, rgb.getBlue() / 255}, PDDeviceRGB.INSTANCE);

the result is pink-ish (the wrong color), instead of orange-ish (the
correct color).

Reply via email to