Error
Proposal to Enhance QRCode Endpoint in Rock RMS
Overview
This is a proposal for enhancing GetQRCode.ashx so that it can allow for customizing background and foreground colors with RGBA hex values. Currently, GetQRCode.ashx only supports black and white as defaults. This proposal was done with the intention of allowing transparent background. The library QRCoder that Rock uses for its QR code generation supports hex values for both foreground and background, so that was an easy adjustment.
Proposed Changes
The proposed changes would allow users to specify both the foreground and background colors using any hex value, including RGBA. This flexibility will help churches create QR codes that seamlessly integrate into their marketing materials, websites, and event signage.
Desired Features
These would be included as query parameters to the URL endpoint.
API Changes
To implement these features, the following changes are suggested for the QRCode endpoint:
1. Add Parameters:
- foregroundColor: String (hex/RGBA)
- backgroundColor: String (hex/RGBA)
Both of these parameters would be optional. They would simply default to black and white as normal if left blank/missing.
2. Example Request:
GetQRCode.ashx?data=https://example.com&foregroundColor=%23FF5733&backgroundColor=%23FFFFFF
This can obviously be implemented in various ways. In my testing I just passed the hex values in without the hash, and appended it before creating the images.
Screenshots
Here are three examples that use the changes:
This will be in Rock v17 (as of 1.17.0.27)
Cultivate your ideas for maximum impact with these helpful submission tips that will increase the chances of your brilliant concepts becoming reality.