:octocat: added QRMatrix::M_*_DARK constants for convenience

This commit is contained in:
smiley
2023-03-12 14:32:02 +01:00
parent 428df0d78d
commit 51d7c2b8a3
21 changed files with 270 additions and 251 deletions
+17 -17
View File
@@ -23,32 +23,32 @@ $options = new QROptions([
'cachefile' => __DIR__.'/test.eps', // save to file
'moduleValues' => [
// finder
(QRMatrix::M_FINDER | QRMatrix::IS_DARK) => [0, 63, 255], // dark (true)
QRMatrix::M_FINDER => [233, 233, 233], // light (false)
(QRMatrix::M_FINDER_DOT | QRMatrix::IS_DARK) => [0, 63, 255], // finder dot, dark (true)
QRMatrix::M_FINDER_DARK => [0, 63, 255], // dark (true)
QRMatrix::M_FINDER_DOT => [0, 63, 255], // finder dot, dark (true)
QRMatrix::M_FINDER => [233, 233, 233], // light (false)
// alignment
(QRMatrix::M_ALIGNMENT | QRMatrix::IS_DARK) => [255, 0, 255],
QRMatrix::M_ALIGNMENT => [233, 233, 233],
QRMatrix::M_ALIGNMENT_DARK => [255, 0, 255],
QRMatrix::M_ALIGNMENT => [233, 233, 233],
// timing
(QRMatrix::M_TIMING | QRMatrix::IS_DARK) => [255, 0, 0],
QRMatrix::M_TIMING => [233, 233, 233],
QRMatrix::M_TIMING_DARK => [255, 0, 0],
QRMatrix::M_TIMING => [233, 233, 233],
// format
(QRMatrix::M_FORMAT | QRMatrix::IS_DARK) => [67, 159, 84],
QRMatrix::M_FORMAT => [233, 233, 233],
QRMatrix::M_FORMAT_DARK => [67, 159, 84],
QRMatrix::M_FORMAT => [233, 233, 233],
// version
(QRMatrix::M_VERSION | QRMatrix::IS_DARK) => [62, 174, 190],
QRMatrix::M_VERSION => [233, 233, 233],
QRMatrix::M_VERSION_DARK => [62, 174, 190],
QRMatrix::M_VERSION => [233, 233, 233],
// data
(QRMatrix::M_DATA | QRMatrix::IS_DARK) => [0, 0, 0],
QRMatrix::M_DATA => [233, 233, 233],
QRMatrix::M_DATA_DARK => [0, 0, 0],
QRMatrix::M_DATA => [233, 233, 233],
// darkmodule
(QRMatrix::M_DARKMODULE | QRMatrix::IS_DARK) => [0, 0, 0],
QRMatrix::M_DARKMODULE => [0, 0, 0],
// separator
QRMatrix::M_SEPARATOR => [233, 233, 233],
QRMatrix::M_SEPARATOR => [233, 233, 233],
// quietzone
QRMatrix::M_QUIETZONE => [233, 233, 233],
QRMatrix::M_QUIETZONE => [233, 233, 233],
// logo (requires a call to QRMatrix::setLogoSpace()), see QRImageWithLogo
QRMatrix::M_LOGO => [233, 233, 233],
QRMatrix::M_LOGO => [233, 233, 233],
],
]);
+16 -15
View File
@@ -22,29 +22,30 @@ $options = new QROptions([
'imageBase64' => false,
'moduleValues' => [
// finder
(QRMatrix::M_FINDER | QRMatrix::IS_DARK) => [0, 63, 255], // dark (true)
QRMatrix::M_FINDER => [255, 255, 255], // light (false), white is the transparency color and is enabled by default
QRMatrix::M_FINDER_DARK => [0, 63, 255], // dark (true)
QRMatrix::M_FINDER_DOT => [0, 63, 255], // finder dot, dark (true)
QRMatrix::M_FINDER => [255, 255, 255], // light (false), white is the transparency color and is enabled by default
// alignment
(QRMatrix::M_ALIGNMENT | QRMatrix::IS_DARK) => [255, 0, 255],
QRMatrix::M_ALIGNMENT => [255, 255, 255],
QRMatrix::M_ALIGNMENT_DARK => [255, 0, 255],
QRMatrix::M_ALIGNMENT => [255, 255, 255],
// timing
(QRMatrix::M_TIMING | QRMatrix::IS_DARK) => [255, 0, 0],
QRMatrix::M_TIMING => [255, 255, 255],
QRMatrix::M_TIMING_DARK => [255, 0, 0],
QRMatrix::M_TIMING => [255, 255, 255],
// format
(QRMatrix::M_FORMAT | QRMatrix::IS_DARK) => [67, 191, 84],
QRMatrix::M_FORMAT => [255, 255, 255],
QRMatrix::M_FORMAT_DARK => [67, 191, 84],
QRMatrix::M_FORMAT => [255, 255, 255],
// version
(QRMatrix::M_VERSION | QRMatrix::IS_DARK) => [62, 174, 190],
QRMatrix::M_VERSION => [255, 255, 255],
QRMatrix::M_VERSION_DARK => [62, 174, 190],
QRMatrix::M_VERSION => [255, 255, 255],
// data
(QRMatrix::M_DATA | QRMatrix::IS_DARK) => [0, 0, 0],
QRMatrix::M_DATA => [255, 255, 255],
QRMatrix::M_DATA_DARK => [0, 0, 0],
QRMatrix::M_DATA => [255, 255, 255],
// darkmodule
(QRMatrix::M_DARKMODULE | QRMatrix::IS_DARK) => [0, 0, 0],
QRMatrix::M_DARKMODULE => [0, 0, 0],
// separator
QRMatrix::M_SEPARATOR => [255, 255, 255],
QRMatrix::M_SEPARATOR => [255, 255, 255],
// quietzone
QRMatrix::M_QUIETZONE => [255, 255, 255],
QRMatrix::M_QUIETZONE => [255, 255, 255],
],
]);
+17 -17
View File
@@ -22,30 +22,30 @@ header('Content-Type: text/html; charset=utf-8');
'cssClass' => 'qrcode',
'moduleValues' => [
// finder
(QRMatrix::M_FINDER | QRMatrix::IS_DARK) => '#A71111', // dark (true)
QRMatrix::M_FINDER => '#FFBFBF', // light (false)
(QRMatrix::M_FINDER_DOT | QRMatrix::IS_DARK) => '#A71111', // finder dot, dark (true)
QRMatrix::M_FINDER_DARK => '#A71111', // dark (true)
QRMatrix::M_FINDER_DOT => '#A71111', // finder dot, dark (true)
QRMatrix::M_FINDER => '#FFBFBF', // light (false)
// alignment
(QRMatrix::M_ALIGNMENT | QRMatrix::IS_DARK) => '#A70364',
QRMatrix::M_ALIGNMENT => '#FFC9C9',
QRMatrix::M_ALIGNMENT_DARK => '#A70364',
QRMatrix::M_ALIGNMENT => '#FFC9C9',
// timing
(QRMatrix::M_TIMING | QRMatrix::IS_DARK) => '#98005D',
QRMatrix::M_TIMING => '#FFB8E9',
QRMatrix::M_TIMING_DARK => '#98005D',
QRMatrix::M_TIMING => '#FFB8E9',
// format
(QRMatrix::M_FORMAT | QRMatrix::IS_DARK) => '#003804',
QRMatrix::M_FORMAT => '#00FB12',
QRMatrix::M_FORMAT_DARK => '#003804',
QRMatrix::M_FORMAT => '#00FB12',
// version
(QRMatrix::M_VERSION | QRMatrix::IS_DARK) => '#650098',
QRMatrix::M_VERSION => '#E0B8FF',
QRMatrix::M_VERSION_DARK => '#650098',
QRMatrix::M_VERSION => '#E0B8FF',
// data
(QRMatrix::M_DATA | QRMatrix::IS_DARK) => '#4A6000',
QRMatrix::M_DATA => '#ECF9BE',
QRMatrix::M_DATA_DARK => '#4A6000',
QRMatrix::M_DATA => '#ECF9BE',
// darkmodule
(QRMatrix::M_DARKMODULE | QRMatrix::IS_DARK) => '#080063',
QRMatrix::M_DARKMODULE => '#080063',
// separator
QRMatrix::M_SEPARATOR => '#AFBFBF',
QRMatrix::M_SEPARATOR => '#AFBFBF',
// quietzone
QRMatrix::M_QUIETZONE => '#DDDDDD',
QRMatrix::M_QUIETZONE => '#DDDDDD',
],
]);
@@ -58,7 +58,7 @@ header('Content-Type: text/html; charset=utf-8');
<title>QRCode test</title>
<style>
div.qrcode{
margin: 5em;
margin: 1em;
}
/* rows */
+21 -21
View File
@@ -17,45 +17,45 @@ $options = new QROptions([
'version' => 7,
'outputType' => QROutputInterface::GDIMAGE_PNG,
'eccLevel' => EccLevel::L,
'scale' => 10,
'scale' => 20,
'imageBase64' => false,
'bgColor' => [200, 200, 200],
'bgColor' => [200, 150, 200],
'imageTransparent' => false,
'drawCircularModules' => true,
'circleRadius' => 0.4,
'keepAsSquare' => [
(QRMatrix::M_FINDER|QRMatrix::IS_DARK),
QRMatrix::M_FINDER_DARK,
QRMatrix::M_FINDER_DOT,
(QRMatrix::M_ALIGNMENT|QRMatrix::IS_DARK),
QRMatrix::M_ALIGNMENT_DARK,
],
'moduleValues' => [
// finder
(QRMatrix::M_FINDER | QRMatrix::IS_DARK) => [0, 63, 255], // dark (true)
QRMatrix::M_FINDER => [233, 233, 233], // light (false), white is the transparency color and is enabled by default
(QRMatrix::M_FINDER_DOT | QRMatrix::IS_DARK) => [0, 63, 255], // finder dot, dark (true)
QRMatrix::M_FINDER_DARK => [0, 63, 255], // dark (true)
QRMatrix::M_FINDER_DOT => [0, 63, 255], // finder dot, dark (true)
QRMatrix::M_FINDER => [233, 233, 233], // light (false), white is the transparency color and is enabled by default
// alignment
(QRMatrix::M_ALIGNMENT | QRMatrix::IS_DARK) => [255, 0, 255],
QRMatrix::M_ALIGNMENT => [233, 233, 233],
QRMatrix::M_ALIGNMENT_DARK => [255, 0, 255],
QRMatrix::M_ALIGNMENT => [233, 233, 233],
// timing
(QRMatrix::M_TIMING | QRMatrix::IS_DARK) => [255, 0, 0],
QRMatrix::M_TIMING => [233, 233, 233],
QRMatrix::M_TIMING_DARK => [255, 0, 0],
QRMatrix::M_TIMING => [233, 233, 233],
// format
(QRMatrix::M_FORMAT | QRMatrix::IS_DARK) => [67, 159, 84],
QRMatrix::M_FORMAT => [233, 233, 233],
QRMatrix::M_FORMAT_DARK => [67, 159, 84],
QRMatrix::M_FORMAT => [233, 233, 233],
// version
(QRMatrix::M_VERSION | QRMatrix::IS_DARK) => [62, 174, 190],
QRMatrix::M_VERSION => [233, 233, 233],
QRMatrix::M_VERSION_DARK => [62, 174, 190],
QRMatrix::M_VERSION => [233, 233, 233],
// data
(QRMatrix::M_DATA | QRMatrix::IS_DARK) => [0, 0, 0],
QRMatrix::M_DATA => [233, 233, 233],
QRMatrix::M_DATA_DARK => [0, 0, 0],
QRMatrix::M_DATA => [233, 233, 233],
// darkmodule
(QRMatrix::M_DARKMODULE | QRMatrix::IS_DARK) => [0, 0, 0],
QRMatrix::M_DARKMODULE => [0, 0, 0],
// separator
QRMatrix::M_SEPARATOR => [233, 233, 233],
QRMatrix::M_SEPARATOR => [233, 233, 233],
// quietzone
QRMatrix::M_QUIETZONE => [233, 233, 233],
QRMatrix::M_QUIETZONE => [233, 233, 233],
// logo (requires a call to QRMatrix::setLogoSpace()), see QRImageWithLogo
QRMatrix::M_LOGO => [233, 233, 233],
QRMatrix::M_LOGO => [233, 233, 233],
],
]);
+20 -19
View File
@@ -17,43 +17,44 @@ $options = new QROptions([
'version' => 7,
'outputType' => QROutputInterface::IMAGICK,
'eccLevel' => EccLevel::L,
'bgColor' => '#cccccc', // overrides the imageTransparent setting
'imageBase64' => false,
'bgColor' => '#ccccaa', // overrides the imageTransparent setting
'imageTransparent' => true,
'scale' => 20,
'drawLightModules' => true,
'drawCircularModules' => true,
'circleRadius' => 0.4,
'keepAsSquare' => [
(QRMatrix::M_FINDER|QRMatrix::IS_DARK),
QRMatrix::M_FINDER_DARK,
QRMatrix::M_FINDER_DOT,
(QRMatrix::M_ALIGNMENT|QRMatrix::IS_DARK),
QRMatrix::M_ALIGNMENT_DARK,
],
'moduleValues' => [
// finder
(QRMatrix::M_FINDER | QRMatrix::IS_DARK) => '#A71111', // dark (true)
QRMatrix::M_FINDER => '#FFBFBF', // light (false)
(QRMatrix::M_FINDER_DOT | QRMatrix::IS_DARK) => '#A71111', // finder dot, dark (true)
QRMatrix::M_FINDER_DARK => '#A71111', // dark (true)
QRMatrix::M_FINDER_DOT => '#A71111', // finder dot, dark (true)
QRMatrix::M_FINDER => '#FFBFBF', // light (false)
// alignment
(QRMatrix::M_ALIGNMENT | QRMatrix::IS_DARK) => '#A70364',
QRMatrix::M_ALIGNMENT => '#FFC9C9',
QRMatrix::M_ALIGNMENT_DARK => '#A70364',
QRMatrix::M_ALIGNMENT => '#FFC9C9',
// timing
(QRMatrix::M_TIMING | QRMatrix::IS_DARK) => '#98005D',
QRMatrix::M_TIMING => '#FFB8E9',
QRMatrix::M_TIMING_DARK => '#98005D',
QRMatrix::M_TIMING => '#FFB8E9',
// format
(QRMatrix::M_FORMAT | QRMatrix::IS_DARK) => '#003804',
QRMatrix::M_FORMAT => '#CCFB12',
QRMatrix::M_FORMAT_DARK => '#003804',
QRMatrix::M_FORMAT => '#CCFB12',
// version
(QRMatrix::M_VERSION | QRMatrix::IS_DARK) => '#650098',
QRMatrix::M_VERSION => '#E0B8FF',
QRMatrix::M_VERSION_DARK => '#650098',
QRMatrix::M_VERSION => '#E0B8FF',
// data
(QRMatrix::M_DATA | QRMatrix::IS_DARK) => '#4A6000',
QRMatrix::M_DATA => '#ECF9BE',
QRMatrix::M_DATA_DARK => '#4A6000',
QRMatrix::M_DATA => '#ECF9BE',
// darkmodule
(QRMatrix::M_DARKMODULE | QRMatrix::IS_DARK) => '#080063',
QRMatrix::M_DARKMODULE => '#080063',
// separator
QRMatrix::M_SEPARATOR => '#DDDDDD',
QRMatrix::M_SEPARATOR => '#DDDDDD',
// quietzone
QRMatrix::M_QUIETZONE => '#DDDDDD',
QRMatrix::M_QUIETZONE => '#DDDDDD',
],
]);
+3 -4
View File
@@ -10,9 +10,8 @@
use chillerlan\QRCode\{QRCode, QRCodeException, QROptions};
use chillerlan\QRCode\Common\EccLevel;
use chillerlan\QRCode\Output\QRImagick;
use chillerlan\QRCode\Data\QRMatrix;
use chillerlan\QRCode\Output\QROutputInterface;
use chillerlan\QRCode\Output\{QRImagick, QROutputInterface};
require_once __DIR__.'/../vendor/autoload.php';
@@ -110,9 +109,9 @@ $options = new ImagickWithLogoOptions([
'drawCircularModules' => true,
'circleRadius' => 0.4,
'keepAsSquare' => [
(QRMatrix::M_FINDER|QRMatrix::IS_DARK),
QRMatrix::M_FINDER_DARK,
QRMatrix::M_FINDER_DOT,
(QRMatrix::M_ALIGNMENT|QRMatrix::IS_DARK),
QRMatrix::M_ALIGNMENT_DARK,
],
]);
+17 -17
View File
@@ -18,32 +18,32 @@ try{
$moduleValues = [
// finder
(QRMatrix::M_FINDER | QRMatrix::IS_DARK) => $_POST['m_finder_dark'],
QRMatrix::M_FINDER => $_POST['m_finder_light'],
(QRMatrix::M_FINDER_DOT | QRMatrix::IS_DARK) => $_POST['m_finder_dot_dark'],
QRMatrix::M_FINDER_DARK => $_POST['m_finder_dark'],
QRMatrix::M_FINDER_DOT => $_POST['m_finder_dot_dark'],
QRMatrix::M_FINDER => $_POST['m_finder_light'],
// alignment
(QRMatrix::M_ALIGNMENT | QRMatrix::IS_DARK) => $_POST['m_alignment_dark'],
QRMatrix::M_ALIGNMENT => $_POST['m_alignment_light'],
QRMatrix::M_ALIGNMENT_DARK => $_POST['m_alignment_dark'],
QRMatrix::M_ALIGNMENT => $_POST['m_alignment_light'],
// timing
(QRMatrix::M_TIMING | QRMatrix::IS_DARK) => $_POST['m_timing_dark'],
QRMatrix::M_TIMING => $_POST['m_timing_light'],
QRMatrix::M_TIMING_DARK => $_POST['m_timing_dark'],
QRMatrix::M_TIMING => $_POST['m_timing_light'],
// format
(QRMatrix::M_FORMAT | QRMatrix::IS_DARK) => $_POST['m_format_dark'],
QRMatrix::M_FORMAT => $_POST['m_format_light'],
QRMatrix::M_FORMAT_DARK => $_POST['m_format_dark'],
QRMatrix::M_FORMAT => $_POST['m_format_light'],
// version
(QRMatrix::M_VERSION | QRMatrix::IS_DARK) => $_POST['m_version_dark'],
QRMatrix::M_VERSION => $_POST['m_version_light'],
QRMatrix::M_VERSION_DARK => $_POST['m_version_dark'],
QRMatrix::M_VERSION => $_POST['m_version_light'],
// data
(QRMatrix::M_DATA | QRMatrix::IS_DARK) => $_POST['m_data_dark'],
QRMatrix::M_DATA => $_POST['m_data_light'],
QRMatrix::M_DATA_DARK => $_POST['m_data_dark'],
QRMatrix::M_DATA => $_POST['m_data_light'],
// darkmodule
(QRMatrix::M_DARKMODULE | QRMatrix::IS_DARK) => $_POST['m_darkmodule_dark'],
QRMatrix::M_DARKMODULE => $_POST['m_darkmodule_dark'],
// separator
QRMatrix::M_SEPARATOR => $_POST['m_separator_light'],
QRMatrix::M_SEPARATOR => $_POST['m_separator_light'],
// quietzone
QRMatrix::M_QUIETZONE => $_POST['m_quietzone_light'],
QRMatrix::M_QUIETZONE => $_POST['m_quietzone_light'],
// logo
QRMatrix::M_LOGO => $_POST['m_logo_light'],
QRMatrix::M_LOGO => $_POST['m_logo_light'],
];
$moduleValues = array_map(function($v){
+2 -2
View File
@@ -34,9 +34,9 @@ $options = new QROptions([
'connectPaths' => true,
// keep modules of these types as square
'keepAsSquare' => [
(QRMatrix::M_FINDER|QRMatrix::IS_DARK),
QRMatrix::M_FINDER_DARK,
QRMatrix::M_FINDER_DOT,
(QRMatrix::M_ALIGNMENT|QRMatrix::IS_DARK),
QRMatrix::M_ALIGNMENT_DARK,
],
// https://developer.mozilla.org/en-US/docs/Web/SVG/Element/linearGradient
'svgDefs' => '
+3 -3
View File
@@ -7,10 +7,10 @@
* @see https://github.com/chillerlan/php-qrcode/issues/127
*/
use chillerlan\QRCode\{QRCode, QROptions};
use chillerlan\QRCode\Common\EccLevel;
use chillerlan\QRCode\Data\QRMatrix;
use chillerlan\QRCode\Output\{QROutputInterface, QRMarkupSVG};
use chillerlan\QRCode\{QRCode, QROptions};
require_once __DIR__.'/../vendor/autoload.php';
@@ -260,8 +260,8 @@ $options = new MeltedOutputOptions([
'outputType' => QROutputInterface::CUSTOM,
'outputInterface' => MeltedSVGQRCodeOutput::class,
'excludeFromConnect' => [
(QRMatrix::M_FINDER|QRMatrix::IS_DARK),
(QRMatrix::M_FINDER_DOT|QRMatrix::IS_DARK),
QRMatrix::M_FINDER_DARK,
QRMatrix::M_FINDER_DOT,
],
'svgDefs' => '
<linearGradient id="rainbow" x1="100%" y2="100%">
+8 -8
View File
@@ -10,10 +10,10 @@
* @noinspection PhpIllegalPsrClassPathInspection
*/
use chillerlan\QRCode\{QRCode, QROptions};
use chillerlan\QRCode\Common\EccLevel;
use chillerlan\QRCode\Data\QRMatrix;
use chillerlan\QRCode\Output\{QROutputInterface, QRMarkupSVG};
use chillerlan\QRCode\{QRCode, QROptions};
require_once __DIR__.'/../vendor/autoload.php';
@@ -59,7 +59,7 @@ class RandomDotsSVGOutput extends QRMarkupSVG{
// randomly assign another $M_TYPE_LAYER for the given types
// note that the layer id has to be an integer value,
// ideally outside the several bitmask values
if($M_TYPE_LAYER === (QRMatrix::M_DATA | QRMatrix::IS_DARK)){
if($M_TYPE_LAYER === QRMatrix::M_DATA_DARK){
$M_TYPE_LAYER = array_rand($this->options->dotColors);
}
@@ -134,17 +134,17 @@ $options = new RandomDotsOptions([
'connectPaths' => true,
'excludeFromConnect' => [
(QRMatrix::M_FINDER|QRMatrix::IS_DARK),
(QRMatrix::M_FINDER_DOT|QRMatrix::IS_DARK),
(QRMatrix::M_ALIGNMENT|QRMatrix::IS_DARK),
QRMatrix::M_FINDER_DARK,
QRMatrix::M_FINDER_DOT,
QRMatrix::M_ALIGNMENT_DARK,
],
'drawCircularModules' => true,
'circleRadius' => 0.4,
'keepAsSquare' => [
(QRMatrix::M_FINDER|QRMatrix::IS_DARK),
(QRMatrix::M_FINDER_DOT|QRMatrix::IS_DARK),
(QRMatrix::M_ALIGNMENT|QRMatrix::IS_DARK),
QRMatrix::M_FINDER_DARK,
QRMatrix::M_FINDER_DOT,
QRMatrix::M_ALIGNMENT_DARK,
],
]);
+8 -8
View File
@@ -191,7 +191,7 @@ class RoundQuietzoneSVGoutput extends QRMarkupSVG{
// randomly assign another $M_TYPE_LAYER for the given types
// note that the layer id has to be an integer value,
// ideally outside the several bitmask values
if($M_TYPE_LAYER === (QRMatrix::M_DATA | QRMatrix::IS_DARK)){
if($M_TYPE_LAYER === QRMatrix::M_DATA_DARK){
$M_TYPE_LAYER = array_rand($this->options->dotColors);
}
@@ -331,17 +331,17 @@ $options = new RoundQuietzoneOptions([
'svgDefs' => $svgDefs,
// 'connectPaths' => true, // this has been set to "always on" internally
'excludeFromConnect' => [
(QRMatrix::M_FINDER|QRMatrix::IS_DARK),
(QRMatrix::M_FINDER_DOT|QRMatrix::IS_DARK),
(QRMatrix::M_ALIGNMENT|QRMatrix::IS_DARK),
(QRMatrix::M_QUIETZONE|QRMatrix::IS_DARK),
QRMatrix::M_FINDER_DARK,
QRMatrix::M_FINDER_DOT,
QRMatrix::M_ALIGNMENT_DARK,
(QRMatrix::M_QUIETZONE | QRMatrix::IS_DARK),
],
'drawCircularModules' => true,
'circleRadius' => 0.4,
'keepAsSquare' => [
(QRMatrix::M_FINDER|QRMatrix::IS_DARK),
(QRMatrix::M_FINDER_DOT|QRMatrix::IS_DARK),
(QRMatrix::M_ALIGNMENT|QRMatrix::IS_DARK),
QRMatrix::M_FINDER_DARK,
QRMatrix::M_FINDER_DOT,
QRMatrix::M_ALIGNMENT_DARK,
],
]);
+2 -2
View File
@@ -125,9 +125,9 @@ $options = new SVGWithLogoOptions([
'connectPaths' => true,
// keep modules of thhese types as square
'keepAsSquare' => [
(QRMatrix::M_FINDER|QRMatrix::IS_DARK),
QRMatrix::M_FINDER_DARK,
QRMatrix::M_FINDER_DOT,
(QRMatrix::M_ALIGNMENT|QRMatrix::IS_DARK),
QRMatrix::M_ALIGNMENT_DARK,
],
// https://developer.mozilla.org/en-US/docs/Web/SVG/Element/linearGradient
'svgDefs' => '
+20 -20
View File
@@ -23,37 +23,37 @@ $options = new QROptions([
'eol' => Color::colorize('reset', "\x00\n"),
'moduleValues' => [
// finder
(QRMatrix::M_FINDER | QRMatrix::IS_DARK) => Color::colorize('fg-black', '🔴'), // dark (true)
QRMatrix::M_FINDER => Color::colorize('fg-black', '⭕'), // light (false)
(QRMatrix::M_FINDER_DOT | QRMatrix::IS_DARK) => Color::colorize('fg-black', '🔴'), // finder dot, dark (true)
QRMatrix::M_FINDER_DARK => Color::colorize('fg-black', '🔴'), // dark (true)
QRMatrix::M_FINDER => Color::colorize('fg-black', '⭕'), // light (false)
QRMatrix::M_FINDER_DOT => Color::colorize('fg-black', '🔴'), // finder dot, dark (true)
// alignment
(QRMatrix::M_ALIGNMENT | QRMatrix::IS_DARK) => Color::colorize('fg-blue', '🔴'),
QRMatrix::M_ALIGNMENT => Color::colorize('fg-blue', '⭕'),
QRMatrix::M_ALIGNMENT_DARK => Color::colorize('fg-blue', '🔴'),
QRMatrix::M_ALIGNMENT => Color::colorize('fg-blue', '⭕'),
// timing
(QRMatrix::M_TIMING | QRMatrix::IS_DARK) => Color::colorize('fg-red', '🔴'),
QRMatrix::M_TIMING => Color::colorize('fg-red', '⭕'),
QRMatrix::M_TIMING_DARK => Color::colorize('fg-red', '🔴'),
QRMatrix::M_TIMING => Color::colorize('fg-red', '⭕'),
// format
(QRMatrix::M_FORMAT | QRMatrix::IS_DARK) => Color::colorize('fg-magenta', '🔴'),
QRMatrix::M_FORMAT => Color::colorize('fg-magenta', '⭕'),
QRMatrix::M_FORMAT_DARK => Color::colorize('fg-magenta', '🔴'),
QRMatrix::M_FORMAT => Color::colorize('fg-magenta', '⭕'),
// version
(QRMatrix::M_VERSION | QRMatrix::IS_DARK) => Color::colorize('fg-green', '🔴'),
QRMatrix::M_VERSION => Color::colorize('fg-green', '⭕'),
QRMatrix::M_VERSION_DARK => Color::colorize('fg-green', '🔴'),
QRMatrix::M_VERSION => Color::colorize('fg-green', '⭕'),
// data
(QRMatrix::M_DATA | QRMatrix::IS_DARK) => Color::colorize('fg-white', '🔴'),
QRMatrix::M_DATA => Color::colorize('fg-white', '⭕'),
QRMatrix::M_DATA_DARK => Color::colorize('fg-white', '🔴'),
QRMatrix::M_DATA => Color::colorize('fg-white', '⭕'),
// darkmodule
(QRMatrix::M_DARKMODULE | QRMatrix::IS_DARK) => Color::colorize('fg-black', '🔴'),
QRMatrix::M_DARKMODULE => Color::colorize('fg-black', '🔴'),
// separator
QRMatrix::M_SEPARATOR => Color::colorize('fg-cyan', '⭕'),
QRMatrix::M_SEPARATOR => Color::colorize('fg-cyan', '⭕'),
// quietzone
QRMatrix::M_QUIETZONE => Color::colorize('fg-cyan', '⭕'),
QRMatrix::M_QUIETZONE => Color::colorize('fg-cyan', '⭕'),
// logo space
QRMatrix::M_LOGO => Color::colorize('fg-yellow', '⭕'),
QRMatrix::M_LOGO => Color::colorize('fg-yellow', '⭕'),
// empty
QRMatrix::M_NULL => Color::colorize('fg-black', '⭕'),
QRMatrix::M_NULL => Color::colorize('fg-black', '⭕'),
// data
(QRMatrix::M_TEST | QRMatrix::IS_DARK) => Color::colorize('fg-white', '🔴'),
QRMatrix::M_TEST => Color::colorize('fg-black', '⭕'),
QRMatrix::M_TEST_DARK => Color::colorize('fg-white', '🔴'),
QRMatrix::M_TEST => Color::colorize('fg-black', '⭕'),
],
]);