zxingify / zxingify-objc

An Objective-C Port of ZXing
Apache License 2.0
3.07k stars 753 forks source link

invert color when creating DataMatrix barcode #373

Closed alex52 closed 6 years ago

alex52 commented 6 years ago

Is it possible to create a DataMatrix barcode with inverted color? (white content)

Even better if it would be possible to do white content on transparent background.

alex52 commented 6 years ago

I've been able to revert the colors using: + (ZXImage )imageWithMatrix:(ZXBitMatrix )matrix onColor:(CGColorRef)onColor offColor:(CGColorRef)offColor

Same by tweaking the parameters for the white or black content with transparent background!

benjohnde commented 6 years ago

Sure it is, and you already hit the right method. You can easily implement such a feature like being able to specify foreground and background colors.