plushie/widget/qr_code

QR code widget builder.

Types

pub type ErrorCorrection {
  Low
  Medium
  Quartile
  High
}

Constructors

  • Low
  • Medium
  • Quartile
  • High

Option type for qr code properties.

pub type Opt {
  CellSize(Int)
  CellColor(color.Color)
  Background(color.Color)
  ErrorCorrection(ErrorCorrection)
  Alt(String)
  Description(String)
  TotalSize(Float)
  A11y(a11y.A11y)
}

Constructors

pub opaque type QrCode

Values

pub fn a11y(qr: QrCode, a: a11y.A11y) -> QrCode

Set accessibility properties for this widget.

pub fn alt(qr: QrCode, a: String) -> QrCode

Set the alt text for accessibility.

pub fn background(qr: QrCode, c: color.Color) -> QrCode

Set the background color.

pub fn build(qr: QrCode) -> node.Node

Build the qr code into a renderable Node.

pub fn cell_color(qr: QrCode, c: color.Color) -> QrCode

Set the QR code cell color.

pub fn cell_size(qr: QrCode, s: Int) -> QrCode

Set the QR code cell size in pixels.

pub fn description(qr: QrCode, d: String) -> QrCode

Set the description text for accessibility.

pub fn error_correction(
  qr: QrCode,
  ec: ErrorCorrection,
) -> QrCode

Set the error correction level.

pub fn new(id: String, data: String) -> QrCode

Create a new qr code builder.

pub fn total_size(qr: QrCode, s: Float) -> QrCode

Set the total size.

pub fn with_opts(qr: QrCode, opts: List(Opt)) -> QrCode

Apply a list of options to a qr code builder.

Search Document