Contrast is everything
Scanners look for dark squares on a lighter background. Dark navy on white is fine. Pale yellow on white will fail. If you squint and can barely see the pattern, a camera will struggle too.
Avoid inverting
Light code on a dark background works on some apps and fails on others. If you want that look, scan test it on several phones, or keep to the classic dark on light.
Gradients and dot shapes
Rounded dots and gradients look good as long as every dot stays dark enough compared with the background. Keep the three large corner squares (the finder patterns) clear and strong, since scanners use them to lock on.
Error correction levels
QR codes include repair data so that they can survive some damage. The levels are L, M, Q and H, which recover about 7, 15, 25 and 30 percent of the code. Higher levels make a denser code, though, so use H only when you add a logo.
Adding a logo
A logo covers part of the code, and error correction fills the gap. Keep it small, in the centre, with a plain border around it, and use the highest correction level. Then scan test, since too large a logo ruins the code.
Ready to make one? Open the QR studio. It's free, and your details stay in your browser.