Re: converting hex to PDColor

2017-03-13 Thread chitgoks
eInt(colorStr.substring(1), 16); >> float r = ((c & 0xFF) >> 16) / 255f; >> float g = ((c & 0x00FF00) >> 8) / 255f; >> float b = ((c & 0xFF) >> 0) / 255f; // The ">> 0" can be omitted >> PDColor pdc =

Re: converting hex to PDColor

2017-03-13 Thread chitgoks
0FF) >> 0) / 255f; // The ">> 0" can be omitted > PDColor pdc = new PDColor( new float[] { r, g, b }, > PDDeviceRGB.INSTANCE); > > 2017-03-13 12:27 GMT+02:00 chitgoks <chitg...@gmail.com>: > > hi again > > > > a little assistance regarding converting hex to

Re: converting hex to PDColor

2017-03-13 Thread Lachezar Dobrev
00) >> 8) / 255f; float b = ((c & 0xFF) >> 0) / 255f; // The ">> 0" can be omitted PDColor pdc = new PDColor( new float[] { r, g, b }, PDDeviceRGB.INSTANCE); 2017-03-13 12:27 GMT+02:00 chitgoks <chitg...@gmail.com>: > hi again > > a little ass

Re: converting hex to PDColor

2017-03-13 Thread Andreas Lehmkühler
> chitgoks <chitg...@gmail.com> hat am 13. März 2017 um 11:27 geschrieben: > > > hi again > > a little assistance regarding converting hex to PDColor. > > please take this example #ff8000 > > and this is my code > > String colorStr = "#ff8

converting hex to PDColor

2017-03-13 Thread chitgoks
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