Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add canvas.tobwstring #984

Merged
merged 1 commit into from
Oct 27, 2024
Merged

Add canvas.tobwstring #984

merged 1 commit into from
Oct 27, 2024

Conversation

Sainan
Copy link
Member

@Sainan Sainan commented Oct 26, 2024

A bit of a compromise on colour, but at least portable.

local canvas = require "canvas"
local c = canvas.qrcode("Hello from Pluto!", { fg = 0xffffff, bg = 0x000000 })
print(c:tobwstring(0xffffff))
--> █▀▀▀▀▀█ ▄ █▄▄ █▀▀▀▀▀█
--> █ ███ █ ▄█▄▄█ █ ███ █
--> █ ▀▀▀ █ ▄▀ █▄ █ ▀▀▀ █
--> ▀▀▀▀▀▀▀ ▀▄▀▄█ ▀▀▀▀▀▀▀
--> ▀▀███ ▀███ █▀▀ ▀▄█▄▀▄
--> █▄▀▄▀█▀█▀▀ ▀█▄▀▄▄██▀ 
--> ▀▀▀▀▀ ▀ █▀█▀ ▄█▄▄▄  ▀
--> █▀▀▀▀▀█ ▀  ▀██▀▄ ▄██ 
--> █ ███ █ █▄ ▄█▄██▄▄ ▄ 
--> █ ▀▀▀ █ █▄ ▀█▀ ▀▄▄█  
--> ▀▀▀▀▀▀▀ ▀   ▀ ▀ ▀  ▀ 

@Sainan Sainan linked an issue Oct 26, 2024 that may be closed by this pull request
@well-in-that-case well-in-that-case merged commit 7393913 into 0.10.0 Oct 27, 2024
8 checks passed
@well-in-that-case well-in-that-case deleted the canvas-str branch October 27, 2024 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

canvas.tostring
2 participants