Skip to content

Commit cfc8b82

Browse files
committed
:octocat:
1 parent 07b95c1 commit cfc8b82

File tree

1 file changed

+46
-35
lines changed

1 file changed

+46
-35
lines changed

Diff for: README.md

+46-35
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespaced, cleaned up, improved and other stuff.
2020
[coverage]: https://app.codecov.io/gh/chillerlan/php-qrcode/tree/v4.3.x
2121
[codacy-badge]: https://img.shields.io/codacy/grade/edccfc4fe5a34b74b1c53ee03f097b8d/v4.3.x?logo=codacy
2222
[codacy]: https://www.codacy.com/gh/chillerlan/php-qrcode/dashboard?branch=v4.3.x
23-
[downloads-badge]: https://img.shields.io/packagist/dt/chillerlan/php-qrcode.svg?logo=packagist
23+
[downloads-badge]: https://img.shields.io/packagist/dt/chillerlan/php-qrcode?logo=packagist
2424
[downloads]: https://packagist.org/packages/chillerlan/php-qrcode/stats
2525
[gh-action-badge]: https://img.shields.io/github/actions/workflow/status/chillerlan/php-qrcode/tests.yml?branch=v4.3.x&logo=github
2626
[gh-action]: https://github.com/chillerlan/php-qrcode/actions/workflows/tests.yml?query=branch%3Av4.3.x
@@ -249,41 +249,41 @@ $options = new QROptions;
249249
// for HTML, SVG and ImageMagick
250250
$options->moduleValues = [
251251
// finder
252-
(QRMatrix::M_FINDER << 8) => '#A71111', // dark (true)
253-
(QRMatrix::M_FINDER_DOT << 8) => '#A71111', // dark (true)
254-
QRMatrix::M_FINDER => '#FFBFBF', // light (false)
252+
QRMatrix::M_FINDER_DARK => '#A71111', // dark (true)
253+
QRMatrix::M_FINDER_DOT_DARK => '#A71111', // dark (true)
254+
QRMatrix::M_FINDER => '#FFBFBF', // light (false)
255255
// alignment
256-
(QRMatrix::M_ALIGNMENT << 8) => '#A70364',
257-
QRMatrix::M_ALIGNMENT => '#FFC9C9',
256+
QRMatrix::M_ALIGNMENT_DARK => '#A70364',
257+
QRMatrix::M_ALIGNMENT => '#FFC9C9',
258258
// timing
259-
(QRMatrix::M_TIMING << 8) => '#98005D',
260-
QRMatrix::M_TIMING => '#FFB8E9',
259+
QRMatrix::M_TIMING_DARK => '#98005D',
260+
QRMatrix::M_TIMING => '#FFB8E9',
261261
// format
262-
(QRMatrix::M_FORMAT << 8) => '#003804',
263-
QRMatrix::M_FORMAT => '#00FB12',
262+
QRMatrix::M_FORMAT_DARK => '#003804',
263+
QRMatrix::M_FORMAT => '#00FB12',
264264
// version
265-
(QRMatrix::M_VERSION << 8) => '#650098',
266-
QRMatrix::M_VERSION => '#E0B8FF',
265+
QRMatrix::M_VERSION_DARK => '#650098',
266+
QRMatrix::M_VERSION => '#E0B8FF',
267267
// data
268-
(QRMatrix::M_DATA << 8) => '#4A6000',
269-
QRMatrix::M_DATA => '#ECF9BE',
268+
QRMatrix::M_DATA_DARK => '#4A6000',
269+
QRMatrix::M_DATA => '#ECF9BE',
270270
// darkmodule
271-
(QRMatrix::M_DARKMODULE << 8) => '#080063',
271+
QRMatrix::M_DARKMODULE_DARK => '#080063',
272272
// separator
273-
QRMatrix::M_SEPARATOR => '#AFBFBF',
273+
QRMatrix::M_SEPARATOR => '#AFBFBF',
274274
// quietzone
275-
QRMatrix::M_QUIETZONE => '#FFFFFF',
275+
QRMatrix::M_QUIETZONE => '#FFFFFF',
276276
];
277277

278278
// for the image output types
279279
$options->moduleValues = [
280-
(QRMatrix::M_DATA << 8) => [0, 0, 0],
280+
QRMatrix::M_DATA_DARK => [0, 0, 0],
281281
// ...
282282
];
283283

284284
// for string/text output
285285
$options->moduleValues = [
286-
(QRMatrix::M_DATA << 8) => '#',
286+
QRMatrix::M_DATA_DARK => '#',
287287
// ...
288288
];
289289
```
@@ -335,20 +335,31 @@ $options->moduleValues = [
335335
| `check(int $x, int $y)` | bool | checks whether a module is true (dark) or false (light) |
336336

337337
#### Constants
338-
| name | light (false) | dark (true) | description |
339-
|----------------|---------------|-------------|---------------------------------------------------------------|
340-
| `M_NULL` | 0 | - | module not set (should never appear. if so, there's an error) |
341-
| `M_DARKMODULE` | - | 512 | once per matrix at `$xy = [8, 4 * $version + 9]` |
342-
| `M_DATA` | 4 | 1024 | the actual encoded data |
343-
| `M_FINDER` | 6 | 1536 | the 7x7 finder patterns |
344-
| `M_SEPARATOR` | 8 | - | separator lines around the finder patterns |
345-
| `M_ALIGNMENT` | 10 | 2560 | the 5x5 alignment patterns |
346-
| `M_TIMING` | 12 | 3072 | the timing pattern lines |
347-
| `M_FORMAT` | 14 | 3584 | format information pattern |
348-
| `M_VERSION` | 16 | 4096 | version information pattern |
349-
| `M_QUIETZONE` | 18 | - | margin around the QR Code |
350-
| `M_LOGO` | 20 | - | space for a logo image (not used yet) |
351-
| `M_TEST` | 255 | 65280 | test value |
338+
| name | description |
339+
|----------------------|---------------------------------------------------------------|
340+
| `M_NULL` | module not set (should never appear. if so, there's an error) |
341+
| `M_DARKMODULE` | once per matrix at `$xy = [8, 4 * $version + 9]` |
342+
| `M_DARKMODULE_LIGHT` | (reserved for reflectance reversal) |
343+
| `M_DATA` | the actual encoded data |
344+
| `M_DATA_DARK` | |
345+
| `M_FINDER` | the 7x7 finder patterns |
346+
| `M_FINDER_DARK` | |
347+
| `M_FINDER_DOT` | the 3x3 dot inside the finder patterns |
348+
| `M_FINDER_DOT_LIGHT` | (reserved for reflectance reversal) |
349+
| `M_SEPARATOR` | separator lines around the finder patterns |
350+
| `M_SEPARATOR_DARK` | (reserved for reflectance reversal) |
351+
| `M_ALIGNMENT` | the 5x5 alignment patterns |
352+
| `M_ALIGNMENT_DARK` | |
353+
| `M_TIMING` | the timing pattern lines |
354+
| `M_TIMING_DARK` | |
355+
| `M_FORMAT` | format information pattern |
356+
| `M_FORMAT_DARK` | |
357+
| `M_VERSION` | version information pattern |
358+
| `M_VERSION_DARK` | |
359+
| `M_QUIETZONE` | margin around the QR Code |
360+
| `M_QUIETZONE_DARK` | (reserved for reflectance reversal) |
361+
| `M_LOGO` | space for a logo image |
362+
| `M_LOGO_DARK` | (reserved for reflectance reversal) |
352363

353364
### `QROptions` API
354365

@@ -372,8 +383,8 @@ $options->moduleValues = [
372383
| `$svgOpacity` | float | 1.0 | 0...1 | |
373384
| `$svgDefs` | string | * | * | anything between [`<defs>`](https://developer.mozilla.org/docs/Web/SVG/Element/defs) |
374385
| `$svgViewBoxSize` | int | `null` | * | a positive integer which defines width/height of the [viewBox attribute](https://css-tricks.com/scale-svg/#article-header-id-3) |
375-
| `$textDark` | string | '🔴' | * | string substitute for dark |
376-
| `$textLight` | string | '⭕' | * | string substitute for light |
386+
| `$textDark` | string | '██' | * | string substitute for dark |
387+
| `$textLight` | string | '░░' | * | string substitute for light |
377388
| `$markupDark` | string | '#000' | * | markup substitute for dark (CSS value) |
378389
| `$markupLight` | string | '#fff' | * | markup substitute for light (CSS value) |
379390
| `$imageBase64` | bool | `true` | - | whether to return the image data as base64 or raw like from `file_get_contents()` |

0 commit comments

Comments
 (0)