momentfree / node-red-contrib-qrcode-generator

Generate QRCode with Node-Red
MIT License
2 stars 0 forks source link

Setting light color to black and dark color to light gives a warning #1

Closed evitiello closed 3 years ago

evitiello commented 3 years ago

I want to invert the standard colors of the QR code, but when I do I receive the warning that the colors are too similar.

  1. Set light color to black
  2. Set dark color to white

Result: warning is shown. Expected Result: no warning

In addition, I would suggest that "light color" should be named "Background color" and "Dark color" should be renamed to "QR Code Color"

Thank you!

momentfree commented 3 years ago

I want to invert the standard colors of the QR code, but when I do I receive the warning that the colors are too similar.

  1. Set light color to black
  2. Set dark color to white

Result: warning is shown. Expected Result: no warning

In addition, I would suggest that "light color" should be named "Background color" and "Dark color" should be renamed to "QR Code Color"

Thank you!

Many qrcode readers/apps doesn't recognize code when background color is darker then qrcode color. I should've made a specific message for this. So the warning should be something like: "colors are too similar or background color is darker then qrcode color."

momentfree commented 3 years ago

fixed some code on color brigthness validation and warning message.

  1. brightness range is from 0 to 255. When background brightness - delta(testing with 30) is less then Qrcode brightness the color validation fails, otherwise validation successful.
  2. modified labels "light color" and "dark color"
  3. modified warning message