Skip to content

Instantly share code, notes, and snippets.

Last active October 6, 2020 14:19
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
  • How to generate a QR code with ruby script
require 'rqrcode'

# qrcode ="mailto:<>?query")
qrcode ="")

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment