SimpleSoftwareIO / simple-qrcode

An easy-to-use PHP QrCode generator with first-party support for Laravel.
https://www.simplesoftware.io/simple-qrcode
MIT License
2.66k stars 363 forks source link

Added support for hex code colors #276

Open fredbradley opened 1 year ago

fredbradley commented 1 year ago

Add support for hex code colors rather than RGB.

Usage:

(new Generator)->color('#fff')->backgroundColor('#000');

Usage for Eye color is slightly different due to complexity:

(new Generator)->eyeColorFromHex(0, '#fff', '#000');

Test suite: I had trouble validating the "getAlpha()" methods on the test suite, but I couldn't work out why as the code should be the same. But Hex codes don't have alpha so it wouldn't make a difference to end result, but if someone can solve the test suite (currently commented out)