Просмотр исходного кода

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

smiley 2 лет назад
Родитель
Сommit
51d7c2b8a3

+ 17 - 17
examples/eps.php

@@ -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
examples/fpdf.php

@@ -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
examples/html.php

@@ -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
examples/image.php

@@ -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
examples/imagick.php

@@ -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
examples/imagickWithLogo.php

@@ -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
examples/qrcode-interactive.php

@@ -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
examples/svg.php

@@ -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
examples/svgMeltedModules.php

@@ -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
examples/svgRandomColoredDots.php

@@ -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
examples/svgRoundQuietzone.php

@@ -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
examples/svgWithLogo.php

@@ -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
examples/text.php

@@ -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', '⭕'),
 	],
 ]);
 

+ 33 - 19
src/Data/QRMatrix.php

@@ -22,33 +22,47 @@ use function array_fill, count, floor, range;
 class QRMatrix{
 
 	/** @var int */
-	public const M_NULL       = 0b000000000000;
+	public const IS_DARK          = 0b100000000000;
 	/** @var int */
-	public const M_DARKMODULE = 0b000000000001;
+	public const M_NULL           = 0b000000000000;
 	/** @var int */
-	public const M_DATA       = 0b000000000010;
+	public const M_DARKMODULE     = 0b000000000001 | self::IS_DARK;
 	/** @var int */
-	public const M_FINDER     = 0b000000000100;
+	public const M_DATA           = 0b000000000010;
 	/** @var int */
-	public const M_SEPARATOR  = 0b000000001000;
+	public const M_DATA_DARK      = 0b000000000010 | self::IS_DARK;
 	/** @var int */
-	public const M_ALIGNMENT  = 0b000000010000;
+	public const M_FINDER         = 0b000000000100;
 	/** @var int */
-	public const M_TIMING     = 0b000000100000;
+	public const M_FINDER_DARK    = 0b000000000100 | self::IS_DARK;
 	/** @var int */
-	public const M_FORMAT     = 0b000001000000;
+	public const M_SEPARATOR      = 0b000000001000;
 	/** @var int */
-	public const M_VERSION    = 0b000010000000;
+	public const M_ALIGNMENT      = 0b000000010000;
 	/** @var int */
-	public const M_QUIETZONE  = 0b000100000000;
+	public const M_ALIGNMENT_DARK = 0b000000010000 | self::IS_DARK;
 	/** @var int */
-	public const M_LOGO       = 0b001000000000;
+	public const M_TIMING         = 0b000000100000;
 	/** @var int */
-	public const M_FINDER_DOT = 0b010000000000;
+	public const M_TIMING_DARK    = 0b000000100000 | self::IS_DARK;
 	/** @var int */
-	public const M_TEST       = 0b011111111111;
+	public const M_FORMAT         = 0b000001000000;
 	/** @var int */
-	public const IS_DARK      = 0b100000000000;
+	public const M_FORMAT_DARK    = 0b000001000000 | self::IS_DARK;
+	/** @var int */
+	public const M_VERSION        = 0b000010000000;
+	/** @var int */
+	public const M_VERSION_DARK   = 0b000010000000 | self::IS_DARK;
+	/** @var int */
+	public const M_QUIETZONE      = 0b000100000000;
+	/** @var int */
+	public const M_LOGO           = 0b001000000000;
+	/** @var int */
+	public const M_FINDER_DOT     = 0b010000000000 | self::IS_DARK;
+	/** @var int */
+	public const M_TEST           = 0b011111111111;
+	/** @var int */
+	public const M_TEST_DARK      = 0b011111111111 | self::IS_DARK;
 
 	/**
 	 * Map of flag => coord
@@ -203,14 +217,14 @@ class QRMatrix{
 	public function set(int $x, int $y, bool $value, int $M_TYPE):self{
 
 		if(isset($this->matrix[$y][$x])){
-			$this->matrix[$y][$x] = ($M_TYPE | (($value) ? $this::IS_DARK : 0));
+			$this->matrix[$y][$x] = (($M_TYPE & ~$this::IS_DARK) | (($value) ? $this::IS_DARK : 0));
 		}
 
 		return $this;
 	}
 
 	/**
-	 * Flips the value of the module
+	 * Flips the value of the module at ($x, $y)
 	 */
 	public function flip(int $x, int $y):self{
 
@@ -222,7 +236,7 @@ class QRMatrix{
 	}
 
 	/**
-	 * Checks whether a module is of the given $M_TYPE
+	 * Checks whether the module at ($x, $y) is of the given $M_TYPE
 	 *
 	 *   true => $value & $M_TYPE === $M_TYPE
 	 */
@@ -251,14 +265,14 @@ class QRMatrix{
 	}
 
 	/**
-	 * Checks whether a module is true (dark) or false (light)
+	 * Checks whether the module at ($x, $y) is true (dark) or false (light)
 	 */
 	public function check(int $x, int $y):bool{
 		return $this->checkType($x, $y, $this::IS_DARK);
 	}
 
 	/**
-	 * Checks the status neighbouring modules of the given module at ($x, $y) and returns a bitmask with the results.
+	 * Checks the status of the neighbouring modules for the module at ($x, $y) and returns a bitmask with the results.
 	 *
 	 * The 8 flags of the bitmask represent the status of each of the neighbouring fields,
 	 * starting with the lowest bit for top left, going clockwise:

+ 20 - 20
src/Output/QROutputInterface.php

@@ -63,27 +63,27 @@ interface QROutputInterface{
 	 */
 	public const DEFAULT_MODULE_VALUES = [
 		// light
-		QRMatrix::M_NULL                             => false,
-		QRMatrix::M_DATA                             => false,
-		QRMatrix::M_FINDER                           => false,
-		QRMatrix::M_SEPARATOR                        => false,
-		QRMatrix::M_ALIGNMENT                        => false,
-		QRMatrix::M_TIMING                           => false,
-		QRMatrix::M_FORMAT                           => false,
-		QRMatrix::M_VERSION                          => false,
-		QRMatrix::M_QUIETZONE                        => false,
-		QRMatrix::M_LOGO                             => false,
-		QRMatrix::M_TEST                             => false,
+		QRMatrix::M_NULL           => false,
+		QRMatrix::M_DATA           => false,
+		QRMatrix::M_FINDER         => false,
+		QRMatrix::M_SEPARATOR      => false,
+		QRMatrix::M_ALIGNMENT      => false,
+		QRMatrix::M_TIMING         => false,
+		QRMatrix::M_FORMAT         => false,
+		QRMatrix::M_VERSION        => false,
+		QRMatrix::M_QUIETZONE      => false,
+		QRMatrix::M_LOGO           => false,
+		QRMatrix::M_TEST           => false,
 		// dark
-		(QRMatrix::M_DARKMODULE | QRMatrix::IS_DARK) => true,
-		(QRMatrix::M_DATA | QRMatrix::IS_DARK)       => true,
-		(QRMatrix::M_FINDER | QRMatrix::IS_DARK)     => true,
-		(QRMatrix::M_ALIGNMENT | QRMatrix::IS_DARK)  => true,
-		(QRMatrix::M_TIMING | QRMatrix::IS_DARK)     => true,
-		(QRMatrix::M_FORMAT | QRMatrix::IS_DARK)     => true,
-		(QRMatrix::M_VERSION | QRMatrix::IS_DARK)    => true,
-		(QRMatrix::M_FINDER_DOT | QRMatrix::IS_DARK) => true,
-		(QRMatrix::M_TEST | QRMatrix::IS_DARK)       => true,
+		QRMatrix::M_DARKMODULE     => true,
+		QRMatrix::M_DATA_DARK      => true,
+		QRMatrix::M_FINDER_DARK    => true,
+		QRMatrix::M_ALIGNMENT_DARK => true,
+		QRMatrix::M_TIMING_DARK    => true,
+		QRMatrix::M_FORMAT_DARK    => true,
+		QRMatrix::M_VERSION_DARK   => true,
+		QRMatrix::M_FINDER_DOT     => true,
+		QRMatrix::M_TEST_DARK      => true,
 	];
 
 	/**

+ 53 - 49
tests/Data/QRMatrixTest.php

@@ -19,7 +19,7 @@ use Generator;
 use function defined;
 
 /**
- * Tests the QRMatix class
+ * Tests the QRMatrix class
  */
 final class QRMatrixTest extends TestCase{
 
@@ -55,37 +55,37 @@ final class QRMatrixTest extends TestCase{
 			// 🔴 🟠 🟡 🟢 🔵 🟣 ⚫️ ⚪️ 🟤
 			// 🟥 🟧 🟨 🟩 🟦 🟪 ⬛ ⬜ 🟫
 			// finder
-			(QRMatrix::M_FINDER | QRMatrix::IS_DARK)     => '🟥', // dark (true)
-			QRMatrix::M_FINDER                           => '🔴', // light (false)
-			(QRMatrix::M_FINDER_DOT | QRMatrix::IS_DARK) => '🟥', // finder dot, dark (true)
+			QRMatrix::M_FINDER_DARK    => '🟥', // dark (true)
+			QRMatrix::M_FINDER         => '🔴', // light (false)
+			QRMatrix::M_FINDER_DOT     => '🟥', // finder dot, dark (true)
 			// alignment
-			(QRMatrix::M_ALIGNMENT | QRMatrix::IS_DARK)  => '🟧',
-			QRMatrix::M_ALIGNMENT                        => '🟠',
+			QRMatrix::M_ALIGNMENT_DARK => '🟧',
+			QRMatrix::M_ALIGNMENT      => '🟠',
 			// timing
-			(QRMatrix::M_TIMING | QRMatrix::IS_DARK)     => '🟨',
-			QRMatrix::M_TIMING                           => '🟡',
+			QRMatrix::M_TIMING_DARK    => '🟨',
+			QRMatrix::M_TIMING         => '🟡',
 			// format
-			(QRMatrix::M_FORMAT | QRMatrix::IS_DARK)     => '🟪',
-			QRMatrix::M_FORMAT                           => '🟣',
+			QRMatrix::M_FORMAT_DARK    => '🟪',
+			QRMatrix::M_FORMAT         => '🟣',
 			// version
-			(QRMatrix::M_VERSION | QRMatrix::IS_DARK)    => '🟩',
-			QRMatrix::M_VERSION                          => '🟢',
+			QRMatrix::M_VERSION_DARK   => '🟩',
+			QRMatrix::M_VERSION        => '🟢',
 			// data
-			(QRMatrix::M_DATA | QRMatrix::IS_DARK)       => '🟦',
-			QRMatrix::M_DATA                             => '🔵',
-			// darkmodule
-			(QRMatrix::M_DARKMODULE | QRMatrix::IS_DARK) => '🟫',
+			QRMatrix::M_DATA_DARK      => '🟦',
+			QRMatrix::M_DATA           => '🔵',
+			// dark module
+			QRMatrix::M_DARKMODULE     => '🟫',
 			// separator
-			QRMatrix::M_SEPARATOR                        => '⚪️',
-			// quietzone
-			QRMatrix::M_QUIETZONE                        => '⬜',
+			QRMatrix::M_SEPARATOR      => '⚪️',
+			// quiet zone
+			QRMatrix::M_QUIETZONE      => '⬜',
 			// logo space
-			QRMatrix::M_LOGO                             => '⬜',
+			QRMatrix::M_LOGO           => '⬜',
 			// empty
-			QRMatrix::M_NULL                             => '🟤',
+			QRMatrix::M_NULL           => '🟤',
 			// data
-			(QRMatrix::M_TEST | QRMatrix::IS_DARK)       => '⬛',
-			QRMatrix::M_TEST                             => '⚫️',
+			QRMatrix::M_TEST_DARK      => '⬛',
+			QRMatrix::M_TEST           => '⚫️',
 		];
 
 		$out = (new QRString($opt, $matrix))->dump();
@@ -94,7 +94,7 @@ final class QRMatrixTest extends TestCase{
 	}
 
 	/**
-	 * debugging shortcut qirth limit to a single version when using with matrixProvider
+	 * debugging shortcut - limit to a single version when using with matrixProvider
 	 *
 	 * @see QRMatrixTest::matrixProvider()
 	 */
@@ -152,13 +152,20 @@ final class QRMatrixTest extends TestCase{
 	 */
 	public function testGetSetCheck():void{
 		$this->matrix->set(10, 10, true, QRMatrix::M_TEST);
-		$this::assertSame((QRMatrix::M_TEST | QRMatrix::IS_DARK), $this->matrix->get(10, 10));
+		$this::assertSame(QRMatrix::M_TEST_DARK, $this->matrix->get(10, 10));
 		$this::assertTrue($this->matrix->check(10, 10));
 
 		$this->matrix->set(20, 20, false, QRMatrix::M_TEST);
 		$this::assertSame(QRMatrix::M_TEST, $this->matrix->get(20, 20));
 		$this::assertFalse($this->matrix->check(20, 20));
 
+		// get proper results when using a *_DARK constant
+		$this->matrix->set(30, 30, true, QRMatrix::M_TEST_DARK);
+		$this::assertSame(QRMatrix::M_TEST_DARK, $this->matrix->get(30, 30));
+
+		$this->matrix->set(40, 40, false, QRMatrix::M_TEST_DARK);
+		$this::assertSame(QRMatrix::M_TEST, $this->matrix->get(40, 40));
+
 		// out of range
 		$this::assertFalse($this->matrix->check(-1, -1));
 		$this::assertSame(-1, $this->matrix->get(-1, -1));
@@ -186,7 +193,7 @@ final class QRMatrixTest extends TestCase{
 
 		$this->dm($matrix);
 
-		$this::assertSame((QRMatrix::M_DARKMODULE | QRMatrix::IS_DARK), $matrix->get(8, ($matrix->size() - 8)));
+		$this::assertSame(QRMatrix::M_DARKMODULE, $matrix->get(8, ($matrix->size() - 8)));
 	}
 
 	/**
@@ -199,9 +206,9 @@ final class QRMatrixTest extends TestCase{
 
 		$this->dm($matrix);
 
-		$this::assertSame((QRMatrix::M_FINDER | QRMatrix::IS_DARK), $matrix->get(0, 0));
-		$this::assertSame((QRMatrix::M_FINDER | QRMatrix::IS_DARK), $matrix->get(0, ($matrix->size() - 1)));
-		$this::assertSame((QRMatrix::M_FINDER | QRMatrix::IS_DARK), $matrix->get(($matrix->size() - 1), 0));
+		$this::assertSame(QRMatrix::M_FINDER_DARK, $matrix->get(0, 0));
+		$this::assertSame(QRMatrix::M_FINDER_DARK, $matrix->get(0, ($matrix->size() - 1)));
+		$this::assertSame(QRMatrix::M_FINDER_DARK, $matrix->get(($matrix->size() - 1), 0));
 	}
 
 	/**
@@ -245,7 +252,7 @@ final class QRMatrixTest extends TestCase{
 			foreach($alignmentPattern as $px){
 				// skip finder pattern
 				if(!$matrix->checkTypeIn($px, $py, [QRMatrix::M_FINDER, QRMatrix::M_FINDER_DOT])){
-					$this::assertSame((QRMatrix::M_ALIGNMENT | QRMatrix::IS_DARK), $matrix->get($px, $py));
+					$this::assertSame(QRMatrix::M_ALIGNMENT_DARK, $matrix->get($px, $py));
 				}
 			}
 		}
@@ -273,8 +280,8 @@ final class QRMatrixTest extends TestCase{
 			if(($i % 2) === 0){
 				// skip alignment pattern
 				if(!$matrix->checkTypeIn(6, $i, [QRMatrix::M_ALIGNMENT])){
-					$this::assertSame((QRMatrix::M_TIMING | QRMatrix::IS_DARK), $matrix->get(6, $i));
-					$this::assertSame((QRMatrix::M_TIMING | QRMatrix::IS_DARK), $matrix->get($i, 6));
+					$this::assertSame(QRMatrix::M_TIMING_DARK, $matrix->get(6, $i));
+					$this::assertSame(QRMatrix::M_TIMING_DARK, $matrix->get($i, 6));
 				}
 			}
 		}
@@ -346,8 +353,8 @@ final class QRMatrixTest extends TestCase{
 
 		$s = ($size - 1 - $quietZoneSize);
 
-		$this::assertSame((QRMatrix::M_TEST | QRMatrix::IS_DARK), $matrix->get($quietZoneSize, $quietZoneSize));
-		$this::assertSame((QRMatrix::M_TEST | QRMatrix::IS_DARK), $matrix->get($s, $s));
+		$this::assertSame(QRMatrix::M_TEST_DARK, $matrix->get($quietZoneSize, $quietZoneSize));
+		$this::assertSame(QRMatrix::M_TEST_DARK, $matrix->get($s, $s));
 	}
 
 	/**
@@ -423,16 +430,16 @@ final class QRMatrixTest extends TestCase{
 		// logo space should not overwrite quiet zone & function patterns
 		$matrix->setLogoSpace(21, 21, -10, -10);
 		$this::assertSame(QRMatrix::M_QUIETZONE, $matrix->get(9, 9));
-		$this::assertSame((QRMatrix::M_FINDER | QRMatrix::IS_DARK), $matrix->get(10, 10));
-		$this::assertSame((QRMatrix::M_FINDER | QRMatrix::IS_DARK), $matrix->get(16, 16));
+		$this::assertSame(QRMatrix::M_FINDER_DARK, $matrix->get(10, 10));
+		$this::assertSame(QRMatrix::M_FINDER_DARK, $matrix->get(16, 16));
 		$this::assertSame(QRMatrix::M_SEPARATOR, $matrix->get(17, 17));
-		$this::assertSame((QRMatrix::M_FORMAT | QRMatrix::IS_DARK), $matrix->get(18, 18));
+		$this::assertSame(QRMatrix::M_FORMAT_DARK, $matrix->get(18, 18));
 		$this::assertSame(QRMatrix::M_LOGO, $matrix->get(19, 19));
 		$this::assertSame(QRMatrix::M_LOGO, $matrix->get(20, 20));
 		$this::assertNotSame(QRMatrix::M_LOGO, $matrix->get(21, 21));
 
-		// i just realized that setLogoSpace() could be called multiple times
-		// on the same instance and i'm not going to do anything about it :P
+		// Ii just realized that setLogoSpace() could be called multiple times
+		// on the same instance, and I'm not going to do anything about it :P
 		$matrix->setLogoSpace(21, 21, 45, 45);
 		$this::assertNotSame(QRMatrix::M_LOGO, $matrix->get(54, 54));
 		$this::assertSame(QRMatrix::M_LOGO, $matrix->get(55, 55));
@@ -481,23 +488,20 @@ final class QRMatrixTest extends TestCase{
 	 * Tests flipping the value of a module
 	 */
 	public function testFlip():void{
-		// using the dark module here because i'm lazy
-		$this->matrix->setDarkModule();
-		$x = 8;
-		$y = ($this->matrix->size() - 8);
+		$this->matrix->set(20, 20, true, QRMatrix::M_TEST);
 
 		// cover checkType()
-		$this::assertTrue($this->matrix->checkType($x, $y, QRMatrix::M_DARKMODULE));
+		$this::assertTrue($this->matrix->checkType(20, 20, QRMatrix::M_TEST));
 		// verify the current state (dark)
-		$this::assertSame((QRMatrix::M_DARKMODULE | QRMatrix::IS_DARK), $this->matrix->get($x, $y));
+		$this::assertSame(QRMatrix::M_TEST_DARK, $this->matrix->get(20, 20));
 		// flip
-		$this->matrix->flip($x, $y);
+		$this->matrix->flip(20, 20);
 		// verify flip
-		$this::assertSame(QRMatrix::M_DARKMODULE, $this->matrix->get($x, $y));
+		$this::assertSame(QRMatrix::M_TEST, $this->matrix->get(20, 20));
 		// flip again
-		$this->matrix->flip($x, $y);
+		$this->matrix->flip(20, 20);
 		// verify flip
-		$this::assertSame((QRMatrix::M_DARKMODULE | QRMatrix::IS_DARK), $this->matrix->get($x, $y));
+		$this::assertSame(QRMatrix::M_TEST_DARK, $this->matrix->get(20, 20));
 	}
 
 	/**

+ 2 - 2
tests/Output/QRFpdfTest.php

@@ -43,8 +43,8 @@ final class QRFpdfTest extends QROutputTestAbstract{
 
 		$this->options->moduleValues = [
 			// 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],
 		];
 
 		$this->outputInterface = new $this->FQN($this->options, $this->matrix);

+ 2 - 2
tests/Output/QRGdImageTestAbstract.php

@@ -40,8 +40,8 @@ abstract class QRGdImageTestAbstract extends QROutputTestAbstract{
 
 		$this->options->moduleValues = [
 			// 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],
 		];
 
 		$this->outputInterface = new $this->FQN($this->options, $this->matrix);

+ 2 - 2
tests/Output/QRImagickTest.php

@@ -44,8 +44,8 @@ final class QRImagickTest extends QROutputTestAbstract{
 
 		$this->options->moduleValues = [
 			// data
-			(QRMatrix::M_DATA | QRMatrix::IS_DARK) => '#4A6000',
-			QRMatrix::M_DATA                       => '#ECF9BE',
+			QRMatrix::M_DATA_DARK => '#4A6000',
+			QRMatrix::M_DATA      => '#ECF9BE',
 		];
 
 		$this->outputInterface = new $this->FQN($this->options, $this->matrix);

+ 2 - 2
tests/Output/QRMarkupTestAbstract.php

@@ -25,8 +25,8 @@ abstract class QRMarkupTestAbstract extends QROutputTestAbstract{
 		$this->options->drawLightModules = true;
 		$this->options->moduleValues     = [
 			// data
-			(QRMatrix::M_DATA | QRMatrix::IS_DARK) => '#4A6000',
-			QRMatrix::M_DATA                       => '#ECF9BE',
+			QRMatrix::M_DATA_DARK => '#4A6000',
+			QRMatrix::M_DATA      => '#ECF9BE',
 		];
 
 		$this->outputInterface = new $this->FQN($this->options, $this->matrix);

+ 2 - 2
tests/Output/QRStringTEXTTest.php

@@ -27,8 +27,8 @@ final class QRStringTEXTTest extends QRStringTestAbstract{
 
 		$this->options->moduleValues = [
 			// data
-			(QRMatrix::M_DATA | QRMatrix::IS_DARK) => 'A',
-			QRMatrix::M_DATA                       => 'B',
+			QRMatrix::M_DATA_DARK => 'A',
+			QRMatrix::M_DATA      => 'B',
 		];
 
 		$this->outputInterface = new $this->FQN($this->options, $this->matrix);