如何在 Matlab 中改变二维码的颜色?

how to change the QR code color in Matlab?

您好,我正在使用 MatLab 生成我的二维码,基本上 this toolbox 基于 zxing 库。

我需要将代码的颜色更改为蓝色。我的意思是黑色图案部分需要是蓝色的。我想这只是设置,对吧?但是没找到合适的改。有人知道怎么做吗?

谢谢!

示例代码:

m='qq';
qr=qrcode_gen(m);
colormap(gray);
imagesc(qr);
axis image;

只需更改此行以设置您喜欢的颜色图:

colormap(gray);

例如:

colormap(parula(5))