Skip to content

Add foreground/background color options to barcode image generation - #138

Draft
Gaardsholt with Copilot wants to merge 2 commits into
masterfrom
copilot/add-image-color-option
Draft

Add foreground/background color options to barcode image generation#138
Gaardsholt with Copilot wants to merge 2 commits into
masterfrom
copilot/add-image-color-option

Conversation

Copilot AI commented Aug 27, 2026

Copy link
Copy Markdown

The image.png endpoint only produced black-on-white barcodes with no way to customize colors.

Changes

  • ImageController.cs: Added foreground and background hex string query params (defaults: 000000/ffffff). Parsed via ColorTranslator.FromHtml and applied to BitmapRenderer; invalid values return 400.
  • Index.cshtml: Added color picker inputs for foreground and background (shown only for barcode types, not the HEX box mode).
  • index.js: Passes color values (stripped of #) into the image.png query string.

Example

GET /image.png?text=hello&type=39&width=300&height=100&foreground=ffffff&background=003087

Renders a white-on-navy barcode.

Copilot AI and others added 2 commits August 27, 2026 10:54
Co-authored-by: Gaardsholt <6908373+Gaardsholt@users.noreply.github.com>
Co-authored-by: Gaardsholt <6908373+Gaardsholt@users.noreply.github.com>
Copilot AI changed the title Add foreground/background color options for barcode image generation Add foreground/background color options to barcode image generation Aug 27, 2026
Copilot AI requested a review from Gaardsholt August 27, 2026 10:57
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.

2 participants