Skip to content

Commit 9e484d0

Browse files
committed
:octocat: added QRMatrix::M* constants for dark values, removed M_TEST
1 parent d5d728e commit 9e484d0

File tree

14 files changed

+215
-168
lines changed

14 files changed

+215
-168
lines changed

examples/fpdf.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,30 @@
1818
'imageBase64' => false,
1919
'moduleValues' => [
2020
// finder
21-
(QRMatrix::M_FINDER << 8) => [0, 63, 255], // dark (true)
22-
(QRMatrix::M_FINDER_DOT << 8) => [0, 63, 255],
23-
QRMatrix::M_FINDER => [255, 255, 255], // light (false), white is the transparency color and is enabled by default
21+
QRMatrix::M_FINDER_DARK => [0, 63, 255], // dark (true)
22+
QRMatrix::M_FINDER_DOT => [0, 63, 255],
23+
QRMatrix::M_FINDER => [255, 255, 255], // light (false), white is the transparency color and is enabled by default
2424
// alignment
25-
(QRMatrix::M_ALIGNMENT << 8) => [255, 0, 255],
26-
QRMatrix::M_ALIGNMENT => [255, 255, 255],
25+
QRMatrix::M_ALIGNMENT_DARK => [255, 0, 255],
26+
QRMatrix::M_ALIGNMENT => [255, 255, 255],
2727
// timing
28-
(QRMatrix::M_TIMING << 8) => [255, 0, 0],
29-
QRMatrix::M_TIMING => [255, 255, 255],
28+
QRMatrix::M_TIMING_DARK => [255, 0, 0],
29+
QRMatrix::M_TIMING => [255, 255, 255],
3030
// format
31-
(QRMatrix::M_FORMAT << 8) => [67, 191, 84],
32-
QRMatrix::M_FORMAT => [255, 255, 255],
31+
QRMatrix::M_FORMAT_DARK => [67, 191, 84],
32+
QRMatrix::M_FORMAT => [255, 255, 255],
3333
// version
34-
(QRMatrix::M_VERSION << 8) => [62, 174, 190],
35-
QRMatrix::M_VERSION => [255, 255, 255],
34+
QRMatrix::M_VERSION_DARK => [62, 174, 190],
35+
QRMatrix::M_VERSION => [255, 255, 255],
3636
// data
37-
(QRMatrix::M_DATA << 8) => [0, 0, 0],
38-
QRMatrix::M_DATA => [255, 255, 255],
37+
QRMatrix::M_DATA_DARK => [0, 0, 0],
38+
QRMatrix::M_DATA => [255, 255, 255],
3939
// darkmodule
40-
(QRMatrix::M_DARKMODULE << 8) => [0, 0, 0],
40+
QRMatrix::M_DARKMODULE => [0, 0, 0],
4141
// separator
42-
QRMatrix::M_SEPARATOR => [255, 255, 255],
42+
QRMatrix::M_SEPARATOR => [255, 255, 255],
4343
// quietzone
44-
QRMatrix::M_QUIETZONE => [255, 255, 255],
44+
QRMatrix::M_QUIETZONE => [255, 255, 255],
4545
],
4646
]);
4747

examples/html.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,30 @@
1818
'eccLevel' => QRCode::ECC_L,
1919
'moduleValues' => [
2020
// finder
21-
(QRMatrix::M_FINDER << 8) => '#A71111', // dark (true)
22-
(QRMatrix::M_FINDER_DOT << 8) => '#A71111',
23-
QRMatrix::M_FINDER => '#FFBFBF', // light (false)
21+
QRMatrix::M_FINDER_DARK => '#A71111', // dark (true)
22+
QRMatrix::M_FINDER_DOT => '#A71111',
23+
QRMatrix::M_FINDER => '#FFBFBF', // light (false)
2424
// alignment
25-
(QRMatrix::M_ALIGNMENT << 8) => '#A70364',
26-
QRMatrix::M_ALIGNMENT => '#FFC9C9',
25+
QRMatrix::M_ALIGNMENT_DARK => '#A70364',
26+
QRMatrix::M_ALIGNMENT => '#FFC9C9',
2727
// timing
28-
(QRMatrix::M_TIMING << 8) => '#98005D',
29-
QRMatrix::M_TIMING => '#FFB8E9',
28+
QRMatrix::M_TIMING_DARK => '#98005D',
29+
QRMatrix::M_TIMING => '#FFB8E9',
3030
// format
31-
(QRMatrix::M_FORMAT << 8) => '#003804',
32-
QRMatrix::M_FORMAT => '#00FB12',
31+
QRMatrix::M_FORMAT_DARK => '#003804',
32+
QRMatrix::M_FORMAT => '#00FB12',
3333
// version
34-
(QRMatrix::M_VERSION << 8) => '#650098',
35-
QRMatrix::M_VERSION => '#E0B8FF',
34+
QRMatrix::M_VERSION_DARK => '#650098',
35+
QRMatrix::M_VERSION => '#E0B8FF',
3636
// data
37-
(QRMatrix::M_DATA << 8) => '#4A6000',
38-
QRMatrix::M_DATA => '#ECF9BE',
37+
QRMatrix::M_DATA_DARK => '#4A6000',
38+
QRMatrix::M_DATA => '#ECF9BE',
3939
// darkmodule
40-
(QRMatrix::M_DARKMODULE << 8) => '#080063',
40+
QRMatrix::M_DARKMODULE => '#080063',
4141
// separator
42-
QRMatrix::M_SEPARATOR => '#AFBFBF',
42+
QRMatrix::M_SEPARATOR => '#AFBFBF',
4343
// quietzone
44-
QRMatrix::M_QUIETZONE => '#FFFFFF',
44+
QRMatrix::M_QUIETZONE => '#FFFFFF',
4545
],
4646
]);
4747

examples/image.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,32 +19,32 @@
1919
'imageBase64' => false,
2020
'moduleValues' => [
2121
// finder
22-
(QRMatrix::M_FINDER << 8) => [0, 63, 255], // dark (true)
23-
(QRMatrix::M_FINDER_DOT << 8) => [241, 28, 163], // finder dot, dark (true)
24-
QRMatrix::M_FINDER => [255, 255, 255], // light (false), white is the transparency color and is enabled by default
22+
QRMatrix::M_FINDER_DARK => [0, 63, 255], // dark (true)
23+
QRMatrix::M_FINDER_DOT => [241, 28, 163], // finder dot, dark (true)
24+
QRMatrix::M_FINDER => [255, 255, 255], // light (false), white is the transparency color and is enabled by default
2525
// alignment
26-
(QRMatrix::M_ALIGNMENT << 8) => [255, 0, 255],
27-
QRMatrix::M_ALIGNMENT => [255, 255, 255],
26+
QRMatrix::M_ALIGNMENT_DARK => [255, 0, 255],
27+
QRMatrix::M_ALIGNMENT => [255, 255, 255],
2828
// timing
29-
(QRMatrix::M_TIMING << 8) => [255, 0, 0],
30-
QRMatrix::M_TIMING => [255, 255, 255],
29+
QRMatrix::M_TIMING_DARK => [255, 0, 0],
30+
QRMatrix::M_TIMING => [255, 255, 255],
3131
// format
32-
(QRMatrix::M_FORMAT << 8) => [67, 99, 84],
33-
QRMatrix::M_FORMAT => [255, 255, 255],
32+
QRMatrix::M_FORMAT_DARK => [67, 99, 84],
33+
QRMatrix::M_FORMAT => [255, 255, 255],
3434
// version
35-
(QRMatrix::M_VERSION << 8) => [62, 174, 190],
36-
QRMatrix::M_VERSION => [255, 255, 255],
35+
QRMatrix::M_VERSION_DARK => [62, 174, 190],
36+
QRMatrix::M_VERSION => [255, 255, 255],
3737
// data
38-
(QRMatrix::M_DATA << 8) => [0, 0, 0],
39-
QRMatrix::M_DATA => [255, 255, 255],
38+
QRMatrix::M_DATA_DARK => [0, 0, 0],
39+
QRMatrix::M_DATA => [255, 255, 255],
4040
// darkmodule
41-
(QRMatrix::M_DARKMODULE << 8) => [0, 0, 0],
41+
QRMatrix::M_DARKMODULE => [0, 0, 0],
4242
// separator
43-
QRMatrix::M_SEPARATOR => [255, 255, 255],
43+
QRMatrix::M_SEPARATOR => [255, 255, 255],
4444
// quietzone
45-
QRMatrix::M_QUIETZONE => [255, 255, 255],
45+
QRMatrix::M_QUIETZONE => [255, 255, 255],
4646
// logo (requires a call to QRMatrix::setLogoSpace())
47-
QRMatrix::M_LOGO => [255, 255, 255],
47+
QRMatrix::M_LOGO => [255, 255, 255],
4848
],
4949
]);
5050

examples/imagick.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,30 @@
1818
'scale' => 5,
1919
'moduleValues' => [
2020
// finder
21-
(QRMatrix::M_FINDER << 8) => '#A71111', // dark (true)
22-
(QRMatrix::M_FINDER_DOT << 8) => '#A71111',
23-
QRMatrix::M_FINDER => '#FFBFBF', // light (false)
21+
QRMatrix::M_FINDER_DARK => '#A71111', // dark (true)
22+
QRMatrix::M_FINDER_DOT => '#A71111',
23+
QRMatrix::M_FINDER => '#FFBFBF', // light (false)
2424
// alignment
25-
(QRMatrix::M_ALIGNMENT << 8) => '#A70364',
26-
QRMatrix::M_ALIGNMENT => '#FFC9C9',
25+
QRMatrix::M_ALIGNMENT_DARK => '#A70364',
26+
QRMatrix::M_ALIGNMENT => '#FFC9C9',
2727
// timing
28-
(QRMatrix::M_TIMING << 8) => '#98005D',
29-
QRMatrix::M_TIMING => '#FFB8E9',
28+
QRMatrix::M_TIMING_DARK => '#98005D',
29+
QRMatrix::M_TIMING => '#FFB8E9',
3030
// format
31-
(QRMatrix::M_FORMAT << 8) => '#003804',
32-
QRMatrix::M_FORMAT => '#00FB12',
31+
QRMatrix::M_FORMAT_DARK => '#003804',
32+
QRMatrix::M_FORMAT => '#00FB12',
3333
// version
34-
(QRMatrix::M_VERSION << 8) => '#650098',
35-
QRMatrix::M_VERSION => '#E0B8FF',
34+
QRMatrix::M_VERSION_DARK => '#650098',
35+
QRMatrix::M_VERSION => '#E0B8FF',
3636
// data
37-
(QRMatrix::M_DATA << 8) => '#4A6000',
38-
QRMatrix::M_DATA => '#ECF9BE',
37+
QRMatrix::M_DATA_DARK => '#4A6000',
38+
QRMatrix::M_DATA => '#ECF9BE',
3939
// darkmodule
40-
(QRMatrix::M_DARKMODULE << 8) => '#080063',
40+
QRMatrix::M_DARKMODULE => '#080063',
4141
// separator
42-
QRMatrix::M_SEPARATOR => '#DDDDDD',
42+
QRMatrix::M_SEPARATOR => '#DDDDDD',
4343
// quietzone
44-
QRMatrix::M_QUIETZONE => '#DDDDDD',
44+
QRMatrix::M_QUIETZONE => '#DDDDDD',
4545
],
4646
]);
4747

examples/qrcode-interactive.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,30 @@
1717

1818
$moduleValues = [
1919
// finder
20-
(QRMatrix::M_FINDER << 8) => $_POST['m_finder_dark'],
21-
(QRMatrix::M_FINDER_DOT << 8) => $_POST['m_finder_dark'],
22-
QRMatrix::M_FINDER => $_POST['m_finder_light'],
20+
QRMatrix::M_FINDER_DARK => $_POST['m_finder_dark'],
21+
QRMatrix::M_FINDER_DOT => $_POST['m_finder_dark'],
22+
QRMatrix::M_FINDER => $_POST['m_finder_light'],
2323
// alignment
24-
(QRMatrix::M_ALIGNMENT << 8) => $_POST['m_alignment_dark'],
25-
QRMatrix::M_ALIGNMENT => $_POST['m_alignment_light'],
24+
QRMatrix::M_ALIGNMENT_DARK => $_POST['m_alignment_dark'],
25+
QRMatrix::M_ALIGNMENT => $_POST['m_alignment_light'],
2626
// timing
27-
(QRMatrix::M_TIMING << 8) => $_POST['m_timing_dark'],
28-
QRMatrix::M_TIMING => $_POST['m_timing_light'],
27+
QRMatrix::M_TIMING_DARK => $_POST['m_timing_dark'],
28+
QRMatrix::M_TIMING => $_POST['m_timing_light'],
2929
// format
30-
(QRMatrix::M_FORMAT << 8) => $_POST['m_format_dark'],
31-
QRMatrix::M_FORMAT => $_POST['m_format_light'],
30+
QRMatrix::M_FORMAT_DARK => $_POST['m_format_dark'],
31+
QRMatrix::M_FORMAT => $_POST['m_format_light'],
3232
// version
33-
(QRMatrix::M_VERSION << 8) => $_POST['m_version_dark'],
34-
QRMatrix::M_VERSION => $_POST['m_version_light'],
33+
QRMatrix::M_VERSION_DARK => $_POST['m_version_dark'],
34+
QRMatrix::M_VERSION => $_POST['m_version_light'],
3535
// data
36-
(QRMatrix::M_DATA << 8) => $_POST['m_data_dark'],
37-
QRMatrix::M_DATA => $_POST['m_data_light'],
36+
QRMatrix::M_DATA_DARK => $_POST['m_data_dark'],
37+
QRMatrix::M_DATA => $_POST['m_data_light'],
3838
// darkmodule
39-
(QRMatrix::M_DARKMODULE << 8) => $_POST['m_darkmodule_dark'],
39+
QRMatrix::M_DARKMODULE => $_POST['m_darkmodule_dark'],
4040
// separator
41-
QRMatrix::M_SEPARATOR => $_POST['m_separator_light'],
41+
QRMatrix::M_SEPARATOR => $_POST['m_separator_light'],
4242
// quietzone
43-
QRMatrix::M_QUIETZONE => $_POST['m_quietzone_light'],
43+
QRMatrix::M_QUIETZONE => $_POST['m_quietzone_light'],
4444
];
4545

4646
$moduleValues = array_map(function($v){

examples/svg.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
'outputType' => QRCode::OUTPUT_MARKUP_SVG,
2121
'imageBase64' => false,
2222
'eccLevel' => QRCode::ECC_L,
23-
'svgViewBoxSize' => 530,
23+
# 'svgViewBoxSize' => 530,
2424
'addQuietzone' => true,
2525
'svgOpacity' => 1.0,
2626
'svgDefs' => '
@@ -35,30 +35,30 @@
3535
<style>rect{shape-rendering:crispEdges}</style>',
3636
'moduleValues' => [
3737
// finder
38-
(QRMatrix::M_FINDER << 8) => 'url(#g1)', // dark (true)
39-
(QRMatrix::M_FINDER_DOT << 8) => 'url(#g1)',
40-
QRMatrix::M_FINDER => '#fff', // light (false)
38+
QRMatrix::M_FINDER_DARK => 'url(#g1)', // dark (true)
39+
QRMatrix::M_FINDER_DOT => 'url(#g1)',
40+
QRMatrix::M_FINDER => '#fff', // light (false)
4141
// alignment
42-
(QRMatrix::M_ALIGNMENT << 8) => 'url(#g1)',
43-
QRMatrix::M_ALIGNMENT => '#fff',
42+
QRMatrix::M_ALIGNMENT_DARK => 'url(#g1)',
43+
QRMatrix::M_ALIGNMENT => '#fff',
4444
// timing
45-
(QRMatrix::M_TIMING << 8) => 'url(#g1)',
46-
QRMatrix::M_TIMING => '#fff',
45+
QRMatrix::M_TIMING_DARK => 'url(#g1)',
46+
QRMatrix::M_TIMING => '#fff',
4747
// format
48-
(QRMatrix::M_FORMAT << 8) => 'url(#g1)',
49-
QRMatrix::M_FORMAT => '#fff',
48+
QRMatrix::M_FORMAT_DARK => 'url(#g1)',
49+
QRMatrix::M_FORMAT => '#fff',
5050
// version
51-
(QRMatrix::M_VERSION << 8) => 'url(#g1)',
52-
QRMatrix::M_VERSION => '#fff',
51+
QRMatrix::M_VERSION_DARK => 'url(#g1)',
52+
QRMatrix::M_VERSION => '#fff',
5353
// data
54-
(QRMatrix::M_DATA << 8) => 'url(#g2)',
55-
QRMatrix::M_DATA => '#fff',
54+
QRMatrix::M_DATA_DARK => 'url(#g2)',
55+
QRMatrix::M_DATA => '#fff',
5656
// darkmodule
57-
(QRMatrix::M_DARKMODULE << 8) => 'url(#g1)',
57+
QRMatrix::M_DARKMODULE => 'url(#g1)',
5858
// separator
59-
QRMatrix::M_SEPARATOR => '#fff',
59+
QRMatrix::M_SEPARATOR => '#fff',
6060
// quietzone
61-
QRMatrix::M_QUIETZONE => '#fff',
61+
QRMatrix::M_QUIETZONE => '#fff',
6262
],
6363
]);
6464

0 commit comments

Comments
 (0)