colorsqr-codezxing

Creating colored QR codes using zxing


I am using the google open source java zxing creator: http://code.google.com/p/zxing/

to create QR codes. I have everything in place and working (I'm loading the java files using coldfusion and writing the image to the browser.)

What I want now is to change the black QR colour to something else. Is there an easy way of doing this?

Would I need to edit a decompiled version of the encoder java file? Or is there a way I could add a color argument to the encoding routine?

Thanks Shaun


Solution

  • In MatrixToImageWriter.java (which I assume you are using), under javase/ change the constant BLACK. It is an int in ARGB format and currently has value 0xFF000000. Leave the alpha value at 0xFF. Change the rest to describe your color in hex format. You can do the same with WHITE if you like.