qrcode-rust/examples/encode_svg.rs

16 lines
397 B
Rust
Raw Normal View History

2017-05-22 17:25:32 -05:00
extern crate qrcode;
use qrcode::render::svg;
2018-07-30 03:59:03 -05:00
use qrcode::{EcLevel, QrCode, Version};
2017-05-22 17:25:32 -05:00
fn main() {
let code = QrCode::with_version(b"01234567", Version::Micro(2), EcLevel::L).unwrap();
2018-07-30 03:59:03 -05:00
let image = code
.render()
2017-05-22 17:25:32 -05:00
.min_dimensions(200, 200)
.dark_color(svg::Color("#800000"))
.light_color(svg::Color("#ffff80"))
.build();
println!("{}", image);
}