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 background color #8

Open
alexzhirkevich opened this issue Jun 13, 2024 Discussed in #7 · 0 comments
Open

add background color #8

alexzhirkevich opened this issue Jun 13, 2024 Discussed in #7 · 0 comments

Comments

@alexzhirkevich
Copy link
Owner

Discussed in #7

Originally posted by idrisalshikh June 13, 2024
I've tried to change the background color without success, and I believe this is very important. By default, the QR code color is black, and the background color is determined by the surface where the QR image is displayed. If our design uses a black background, the generated image will be entirely black, making the QR code invisible.

In our application, we can resolve this by changing the background of our container that displays the image. However, the real issue arises when we need to share or save the image as a JPEG. In JPEG format, there is no transparency, so the generated image will have a black background. Since the default QR code color is black, we end up with an all-black image again.

When saving the image in PNG format, I encountered a problem when trying to share the image on WhatsApp; it still appears as a black image. Even if I change the QR code colors to:
colors {
dark = QrBrush.solid(Color.Blue)
frame = QrBrush.solid(Color.Blue)
light = QrBrush.solid(Color.Red)
ball = QrBrush.solid(Color.Blue)
}

image

The image still shows a white background (which represents my application's background color). When I share this image, it looks different because the background changes.

Image

As a result, it would be beneficial if we could control the background color of the QR image directly and add an outer border to ensure consistency across different platforms and formats.

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

No branches or pull requests

1 participant