QR Code encoding and rendering.
Transform a QRCode into a canvas element. The default module size is 5px.
qrCodeView : String -> Html msg
qrCodeView message =
QRCode.encode message
|> Result.map QRCode.toCanvas
|> Result.withDefault
(Html.text "Error while encoding to QRCode.")Transform a QRCode into a canvas element with a given module size in pixels.
Transform a QRCode into a canvas element with a given canvas size in pixels.
Transform a QRCode into a svg element.
qrCodeView : String -> Html msg
qrCodeView message =
QRCode.encode message
|> Result.map QRCode.toSvg
|> Result.withDefault
(Html.text "Error while encoding to QRCode.")Tip: You can determine the size of the generated svg setting
width and height styles.
Transform a QRCode into a string.
"Hello World!"
|> QRCode.encode
|> Result.map QRCode.toString
|> Result.withDefault "Error while encoding to QRCode."Returns:
■■■■■■■ ■■■■ ■■■■■■■
■ ■ ■■■■ ■ ■
■ ■■■ ■ ■■■■■ ■ ■■■ ■
■ ■■■ ■ ■ ■ ■ ■■■ ■
■ ■■■ ■ ■■■■ ■ ■■■ ■
■ ■ ■ ■ ■
■■■■■■■ ■ ■ ■ ■■■■■■■
■ ■■
■■ ■ ■■ ■ ■ ■■■■■
■■ ■■■ ■■■■ ■■■ ■■
■ ■■ ■■ ■■■■■ ■■■■■■
■■ ■■■■ ■ ■
■ ■ ■■■ ■■■■ ■■
■■ ■■■ ■■
■■■■■■■ ■ ■ ■■ ■■■
■ ■ ■ ■ ■ ■
■ ■■■ ■ ■■■ ■
■ ■■■ ■ ■■ ■■■ ■■
■ ■■■ ■ ■ ■ ■ ■ ■ ■ ■
■ ■ ■ ■ ■ ■
■■■■■■■ ■■■ ■ ■■Transform a QRCode into a list of list of bools. The list of bools are the rows. True represents a dark module, False a light one.
Transform a list of list of bools into a QRCode.
QRCode type.