# מחולל קודי QR — ספרייה למפתחים

קודי QR מעוצבים: צורות נקודות ופינות, צבעים ומעברי צבע, לוגו במרכז, מסגרות עם כיתוב. ייצוא ל־PNG, ‏JPEG, ‏WebP ו־SVG. מבוסס על qr-code-styling.

## התקנה

```sh
npm install @openlibsdev/qr-code-generator
```

```js
import QrCodeGenerator from "https://cdn.jsdelivr.net/npm/@openlibsdev/qr-code-generator@1.0.0/+esm";
```

## שימוש

```js
import QrCodeGenerator from "@openlibsdev/qr-code-generator";

const state = QrCodeGenerator.normalize({ data: "https://openlibs.dev", dotsColor: "#0d6efd" });
const qr = QrCodeGenerator.create(state);        // a QRCodeStyling instance
qr.append(document.body);
const blob = await QrCodeGenerator.toBlob(state, "svg");
```

## API

### `QrCodeGenerator.normalize(input)`

יוצר הגדרות מלאות מאובייקט חלקי.

### `QrCodeGenerator.create(state, override)`

יוצר קוד QR (מופע של QRCodeStyling) מההגדרות; הציגו אותו עם append(element)‎.

### `QrCodeGenerator.toBlob(state, extension)`

קוד QR כקובץ: png, ‏jpeg, ‏webp או svg.

### `QrCodeGenerator.toOptions(state)`

הגדרות ← אובייקט האפשרויות של qr-code-styling.

### `QrCodeGenerator.fromOptions(o)`

אובייקט האפשרויות של qr-code-styling ← הגדרות.

### `QrCodeGenerator.applyPreset(state, name)`

מחיל סגנון מוכן.

### `QrCodeGenerator.PRESETS`

סגנונות מוכנים.

### `QrCodeGenerator.DEFAULTS`

הגדרות ברירת מחדל.

### `QrCodeGenerator.LISTS`

ערכים מותרים: צורות נקודות ופינות, רמות תיקון שגיאות ועוד.

### `QrCodeGenerator.APP`

שם הספרייה, הגרסה ותאריך השחרור: {name, version, created}.

### `QrCodeGenerator.QRCodeStyling()`

המחלקה qr-code-styling עצמה, ליכולות שהספרייה הזו אינה מכסה.

### `QrCodeGenerator.findNamedColor(text, lang)`

מוצא צבע בעל שם לפי שמו בשפה הנתונה („כחול כהה” ← #00008b).

### `QrCodeGenerator.frameExtension(state)`

המסגרת עם הכיתוב סביב קוד SVG, כהרחבה של qr-code-styling (העבירו אותה ל־applyExtension).

### `QrCodeGenerator.listNamedColors(lang)`

מציג את הצבעים בעלי שם עם שמותיהם בשפה הנתונה.

### `QrCodeGenerator.mimeFor(ext)`

סוג ה־MIME של סיומת קובץ (png, jpeg, webp, svg).

### `QrCodeGenerator.namedColorTexts(lang)`

תוויות שדה הצבע בשפה הנתונה (הטקסטים של בורר הצבעים), ובאנגלית אם השפה חסרה.

## תלויות

- @imagemagick/magick-wasm 0.0.35 (Apache-2.0)
- @imagemagick/magick-wasm 0.0.35 (Apache-2.0)
- @simonwep/pickr 1.10.2 (MIT)
- @simonwep/pickr 1.10.2 (MIT)
- dejavu-fonts-ttf 2.37.3 (Bitstream Vera Fonts License (free, redistributable); DejaVu changes are public domain)
- imagetracerjs 1.2.6 (Unlicense)
- jspdf 2.5.2 (MIT)
- qr-code-styling 1.9.2 (MIT)

- GitHub: https://github.com/OpenLibsDev/qr-code-generator
- npm: https://www.npmjs.com/package/@openlibsdev/qr-code-generator
- פתיחת האפליקציה: https://openlibs.dev/he/app/qr-code-generator/
