- How to generate a QR code with ruby script
require 'rqrcode'
# qrcode = RQRCode::QRCode.new("mailto:<mwmaki2@gmail.com>?query")
qrcode = RQRCode::QRCode.new("")
png = qrcode.as_png(
bit_depth: 1,
border_modules: 4,
# color_mode: ChunkyPNG::COLOR_GRAYSCALE,
color_mode: ChunkyPNG::Color.rgba(100, 0,0, 128),
color: 'black',
file: nil,
fill: 'white',
module_px_size: 16,
resize_exactly_to: true,
resize_gte_to: true,
size: 360
)
IO.write("/Users/mustafa.azzawie/desktop/github-qrcode1.png", png.to_s)