QR Code image generator with customizable image formats, error correction levels, and styling options
Create a QR code image generator that produces styled QR codes with custom visual appearance.
Implement a module that generates QR codes with the following capabilities:
Create QR codes that can be saved as image files. The generator should:
Support custom color schemes for the generated QR codes:
Generate QR codes in different image formats:
Standard PIL-based PNG images with custom colors
SVG path-based output for scalable vector graphics
When encoding "Hello World" with dark blue foreground and white background, the resulting image should be scannable and contain the correct data @test
When generating an SVG for "Test123", the output should be an SVG image object that can be saved @test
When creating a QR code with high error correction and a border of 5, the resulting image should have the specified border width @test
@generates
def generate_styled_qr(data: str, fill_color: str = "black", back_color: str = "white") -> object:
"""
Generate a styled QR code with custom colors.
Args:
data: The text data to encode in the QR code
fill_color: Color for the QR code modules (default: "black")
back_color: Color for the background (default: "white")
Returns:
A PIL Image object containing the styled QR code
"""
pass
def generate_svg_qr(data: str) -> object:
"""
Generate an SVG QR code.
Args:
data: The text data to encode in the QR code
Returns:
An SVG image object
"""
passProvides QR code generation functionality with support for various image formats and styling options.
@satisfied-by
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10