All Plugins
QR Code
UtilitiesGenerate customizable QR codes with colors, logos, and styling options. Perfect for marketing materials and digital experiences.
Installation
npm install @teamflojo/floimg-qr Quick Start
import createClient from "@teamflojo/floimg";
import qr from "@teamflojo/floimg-qr";
const floimg = createClient();
floimg.registerGenerator(qr());
const qrCode = await floimg.generate({
generator: "qr",
params: {
text: "https://floimg.com",
color: "#000000",
backgroundColor: "#ffffff",
size: 400
}
});
await floimg.save(qrCode, "./website-qr.png"); API Reference
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | The text or URL to encode |
size | number | No | QR code size in pixels (default: 200) |
color | string | No | Foreground color (default: #000000) |
backgroundColor | string | No | Background color (default: #ffffff) |
errorCorrectionLevel | "L" | "M" | "Q" | "H" | No | Error correction level (default: M) |
Examples
Basic QR Code
Simple black and white QR code
await floimg.generate({
generator: "qr",
params: {
text: "https://floimg.com",
size: 300
}
});
Branded QR Code
QR code with custom colors
await floimg.generate({
generator: "qr",
params: {
text: "https://floimg.com",
color: "#6366f1",
backgroundColor: "#f8fafc",
size: 400
}
});
Dark Theme QR
Inverted colors for dark backgrounds
await floimg.generate({
generator: "qr",
params: {
text: "https://floimg.com",
color: "#ffffff",
backgroundColor: "#18181b",
size: 300
}
});