qrkit/render/svg

SVG renderer for qrkit QR codes.

Types

pub opaque type SvgOptions

Values

pub fn default_options() -> SvgOptions

Default SVG rendering options.

pub fn to_string(qr: qrkit.QrCode, options: SvgOptions) -> String

Render a QR code as an SVG document string.

pub fn with_background(
  options: SvgOptions,
  draw: Bool,
) -> SvgOptions

Toggle the background rectangle.

pub fn with_dark_color(
  options: SvgOptions,
  css_color: String,
) -> SvgOptions

Set the dark module colour.

pub fn with_light_color(
  options: SvgOptions,
  css_color: String,
) -> SvgOptions

Set the light/background colour.

pub fn with_margin(
  options: SvgOptions,
  modules: Int,
) -> SvgOptions

Set the quiet-zone margin in modules.

Negative values are normalised to 0.

pub fn with_module_size(
  options: SvgOptions,
  px: Int,
) -> SvgOptions

Set the SVG module size.

Values less than 1 are normalised to 1 to keep the rendered output usable.

Search Document